Browse Source

fix windows build

remotes/origin/fix-insecure-world-writable-dir
Gal Schlezinger 8 months ago
parent
commit
d3aa611a38
  1. 21
      src/commands/env.rs

21
src/commands/env.rs

@ -35,17 +35,16 @@ fn generate_symlink_path() -> String {
} }
fn make_symlink(config: &FnmConfig) -> Result<std::path::PathBuf, Error> { fn make_symlink(config: &FnmConfig) -> Result<std::path::PathBuf, Error> {
let base_dir = if cfg!(windows) { #[cfg(windows)]
config.multishell_storage().ensure_exists_silently() let base_dir = { config.multishell_storage().ensure_exists_silently() };
} else { #[cfg(not(windows))]
config let base_dir = config
.multishell_storage() .multishell_storage()
.ensure_exists_silently_with_permissions(|permissions| { .ensure_exists_silently_with_permissions(|permissions| {
use std::os::unix::fs::PermissionsExt; use std::os::unix::fs::PermissionsExt;
// r/w only for owner // r/w only for owner
permissions.set_mode(0o700); permissions.set_mode(0o700);
}) });
};
let mut temp_dir = base_dir.join(generate_symlink_path()); let mut temp_dir = base_dir.join(generate_symlink_path());

Loading…
Cancel
Save