|
|
@ -86,8 +86,12 @@ impl Command for Use { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
fs::remove_symlink_dir(&multishell_path).context(SymlinkingDeletionIssue)?; |
|
|
|
let symlink_deletion_result = fs::remove_symlink_dir(&multishell_path); |
|
|
|
fs::symlink_dir(version_path, &multishell_path).context(SymlinkingCreationIssue)?; |
|
|
|
let symlink_result = fs::symlink_dir(version_path, &multishell_path); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
symlink_result |
|
|
|
|
|
|
|
.or(symlink_deletion_result) |
|
|
|
|
|
|
|
.context(SymlinkingCreationIssue)?; |
|
|
|
|
|
|
|
|
|
|
|
Ok(()) |
|
|
|
Ok(()) |
|
|
|
} |
|
|
|
} |
|
|
@ -145,8 +149,6 @@ fn warn_if_multishell_path_not_in_path_env_var( |
|
|
|
pub enum Error { |
|
|
|
pub enum Error { |
|
|
|
#[snafu(display("Can't create the symlink: {}", source))] |
|
|
|
#[snafu(display("Can't create the symlink: {}", source))] |
|
|
|
SymlinkingCreationIssue { source: std::io::Error }, |
|
|
|
SymlinkingCreationIssue { source: std::io::Error }, |
|
|
|
#[snafu(display("Can't delete the symlink: {}", source))] |
|
|
|
|
|
|
|
SymlinkingDeletionIssue { source: std::io::Error }, |
|
|
|
|
|
|
|
#[snafu(display("{}", source))] |
|
|
|
#[snafu(display("{}", source))] |
|
|
|
InstallError { source: <Install as Command>::Error }, |
|
|
|
InstallError { source: <Install as Command>::Error }, |
|
|
|
#[snafu(display("Can't get locally installed versions: {}", source))] |
|
|
|
#[snafu(display("Can't get locally installed versions: {}", source))] |
|
|
|