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

install --sudo destination path must exist to be canonicalized #1352

Merged
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
6 changes: 5 additions & 1 deletion cargo-pgrx/src/command/sudo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ impl CommandExecute for SudoInstall {
eprintln!("Using sudo to copy extension files from {}", outdir.display().cyan());
for src in output_files {
let src = src.canonicalize()?;
let dest = make_absolute(src.strip_prefix(&outdir)?).canonicalize()?;
let dest_abs = make_absolute(src.strip_prefix(&outdir)?);
let dest = match dest_abs.canonicalize() {
Ok(path) => path,
Err(_) => dest_abs,
};

// we're about to run `sudo` to copy some files, one at a time
let mut command = Command::new("sudo"); // NB: If we ever support Windows...
Expand Down