Skip to content

Commit

Permalink
issue #2 | move temp working dir
Browse files Browse the repository at this point in the history
- Move the temp dir to the same directory of the current executable
  since `std::fs::rename` requires `to` and `from` to be on
  the same filesystem.
  • Loading branch information
jaemk committed Jul 28, 2017
1 parent 09240eb commit 338d0bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backends/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ impl Updater {
prompt_ok("Do you want to continue? [Y/n] ")?;
}

let tmp_dir = tempdir::TempDir::new(&format!("__{}-download", self.bin_name))?;
let tmp_dir_parent = self.bin_install_path.parent()
.expect(&format!("Failed to determine parent dir of `bin_install_path`: {:?}", self.bin_install_path));
let tmp_dir = tempdir::TempDir::new_in(&tmp_dir_parent, &format!("{}_download", self.bin_name))?;
let tmp_tarball_path = tmp_dir.path().join(&target_asset.name);
let mut tmp_tarball = fs::File::create(&tmp_tarball_path)?;

Expand Down

0 comments on commit 338d0bb

Please sign in to comment.