Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ityuany committed Apr 16, 2024
1 parent 66bbcbb commit e6e55d3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use snm_pnpm::snm_pnpm::SnmPnpm;
use snm_yarn::{snm_yarn::SnmYarn, snm_yarnpkg::SnmYarnPkg};
use std::{
fs,
ops::Not,
process::{Command, Stdio},
};
mod manage_command;
Expand Down Expand Up @@ -98,11 +99,13 @@ async fn execute_cli() -> Result<(), SnmError> {
let output_string = String::from_utf8(output).unwrap();

if let Some(home) = dirs::home_dir() {
let spec_path_buf = home
.join(".fig")
.join("autocomplete")
.join("build")
.join("snm.ts");
let dir = home.join(".fig").join("autocomplete").join("build");

if dir.exists().not() {
fs::create_dir_all(&dir)?;
}

let spec_path_buf = dir.join("snm.ts");

if spec_path_buf.exists() {
fs::remove_file(&spec_path_buf)?;
Expand Down

0 comments on commit e6e55d3

Please sign in to comment.