mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
fix(cli/upgrade): upgrade fails on Windows with space in temp path (#6522)
This commit is contained in:
parent
db36857288
commit
a690a20679
2 changed files with 23 additions and 2 deletions
|
@ -419,6 +419,27 @@ fn upgrade_in_tmpdir() {
|
||||||
// TODO(ry) assert!(mtime1 < mtime2);
|
// TODO(ry) assert!(mtime1 < mtime2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warning: this test requires internet access.
|
||||||
|
#[test]
|
||||||
|
fn upgrade_with_space_in_path() {
|
||||||
|
let temp_dir = tempfile::Builder::new()
|
||||||
|
.prefix("directory with spaces")
|
||||||
|
.tempdir()
|
||||||
|
.unwrap();
|
||||||
|
let exe_path = temp_dir.path().join("deno");
|
||||||
|
let _ = std::fs::copy(util::deno_exe_path(), &exe_path).unwrap();
|
||||||
|
assert!(exe_path.exists());
|
||||||
|
let status = Command::new(&exe_path)
|
||||||
|
.arg("upgrade")
|
||||||
|
.arg("--force")
|
||||||
|
.env("TMP", temp_dir.path())
|
||||||
|
.spawn()
|
||||||
|
.unwrap()
|
||||||
|
.wait()
|
||||||
|
.unwrap();
|
||||||
|
assert!(status.success());
|
||||||
|
}
|
||||||
|
|
||||||
// Warning: this test requires internet access.
|
// Warning: this test requires internet access.
|
||||||
#[test]
|
#[test]
|
||||||
fn upgrade_with_version_in_tmpdir() {
|
fn upgrade_with_version_in_tmpdir() {
|
||||||
|
|
|
@ -204,9 +204,9 @@ fn unpack(archive_data: Vec<u8>) -> Result<PathBuf, ErrBox> {
|
||||||
}",
|
}",
|
||||||
)
|
)
|
||||||
.arg("-Path")
|
.arg("-Path")
|
||||||
.arg(&archive_path)
|
.arg(format!("'{}'", &archive_path.to_str().unwrap()))
|
||||||
.arg("-DestinationPath")
|
.arg("-DestinationPath")
|
||||||
.arg(&temp_dir)
|
.arg(format!("'{}'", &temp_dir.to_str().unwrap()))
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue