Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: fixing #1597 #1622

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/volta-core/src/run/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ impl PackageInstallCommand {
.status()
.with_context(|| ErrorKind::BinaryExecError)?;

if status.success() {
let was_npm_dry_run = self.installer.get_manager() == PackageManager::Npm
&& self
.command
.get_args()
.any(|a| a == "-d" || a == "--dry-run");

if status.success() && !was_npm_dry_run {
self.installer.complete_install(&image)?;
}

Expand Down
5 changes: 4 additions & 1 deletion crates/volta-core/src/run/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ impl<'a> InstallArgs<'a> {
let command = PackageInstallCommand::new(args, platform, self.manager)?;
executors.push(command.into());
}
Ok(internal) => executors.push(InternalInstallCommand::new(internal).into()),
Ok(internal) => {
// TODO: gotta fail here or something?
executors.push(InternalInstallCommand::new(internal).into())
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions crates/volta-core/src/tool/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ impl DirectInstall {
link_package_to_shared_dir(&name, manager)?;
configure::write_config_and_shims(&name, &manifest, image, manager)
}

pub fn get_manager(&self) -> PackageManager {
self.manager
}
}

/// Helper struct for direct in-place upgrades using `npm update -g` or `yarn global upgrade`
Expand Down
Loading