Browse Source

Create the multishells directory if it is missing (#626)

remotes/origin/feat/support-install-latest
Gal Schlezinger 3 years ago committed by GitHub
parent
commit
9526057afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/commands/use.rs

10
src/commands/use.rs

@ -93,6 +93,14 @@ impl Command for Use { @@ -93,6 +93,14 @@ impl Command for Use {
outln!(config, Info, "{}", message);
}
if let Some(multishells_path) = multishell_path.parent() {
std::fs::create_dir_all(multishells_path).map_err(|_err| {
Error::MultishellDirectoryCreationIssue {
path: multishells_path.to_path_buf(),
}
})?;
}
replace_symlink(&version_path, multishell_path).context(SymlinkingCreationIssue)?;
Ok(())
@ -220,6 +228,8 @@ pub enum Error { @@ -220,6 +228,8 @@ pub enum Error {
"Check out our documentation for more information: https://fnm.vercel.app"
))]
FnmEnvWasNotSourced,
#[snafu(display("Can't create the multishell directory: {}", path.display()))]
MultishellDirectoryCreationIssue { path: std::path::PathBuf },
}
#[derive(Debug, Snafu)]

Loading…
Cancel
Save