Skip to content

Commit

Permalink
fix: noz windows path must be correct
Browse files Browse the repository at this point in the history
  • Loading branch information
shiipou committed Sep 18, 2024
1 parent 1c1569d commit 4ce02f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
pub mod projectmanager;
use crate::projectmanager::{nvim, vscode};

const DEFAULT_REGEX: &str = r"(?m)^(?:https?://|git@)?([^/:]+)[/:]([^/]+)/([^\.]+)(?:\.git)?$";
const DEFAULT_REGEX: &str = r"(?m)^(?:https?://|git@)?([^/:]+)[/:]([^/]+)/([^\.]+)(?:\.git)?/?$";

#[derive(Serialize, Deserialize, Debug)]
#[serde(default)]
Expand Down Expand Up @@ -87,9 +87,9 @@ impl Default for AppConfig {
.expect("'USERPROFILE' environment variable must be set.");
AppConfig {
vscode_path_prefix: None,
workspaces_dir: format!("{}/workspaces", user_home_path).into(),
nvim_projectmanager_path: format!("{}/AppData/Roaming/nvim/", user_home_path).into(),
vscode_projectmanager_path: format!("{}/AppData/Roaming/Code/User/globalStorage/alefragnani.project-manager/projects.json", user_home_path).into(),
workspaces_dir: format!("{}\\workspaces", user_home_path).into(),
nvim_projectmanager_path: format!("{}\\AppData\\Roaming\\nvim\\", user_home_path).into(),
vscode_projectmanager_path: format!("{}\\AppData\\Roaming\\Code\\User\\globalStorage\\alefragnani.project-manager\\projects.json", user_home_path).into(),
regex: DEFAULT_REGEX.to_string()
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/projectmanager/nvim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn add_project(
let updated_data =
serde_json::to_string_pretty(&entries).expect("Failed to serialize JSON");
let _ = fs::create_dir_all(&target_path.parent().unwrap());
fs::write(&target_path, updated_data).expect("Unable to write file");
fs::write(&target_path, updated_data).expect("Unable to write Nvim JSON file");
if debug {
println!("Entry added {:#?}", new_entry);
}
Expand Down

0 comments on commit 4ce02f0

Please sign in to comment.