Skip to content

Commit

Permalink
Fix cross device link during install
Browse files Browse the repository at this point in the history
  • Loading branch information
apmorton committed Dec 30, 2024
1 parent 63d90e5 commit 276bf45
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ozy"
version = "0.1.12"
version = "0.1.13"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All changes are in the [Releases](https://github.com/aquanauts/ozy/releases).

### [0.1.13](https://github.com/aquanauts/ozy/releases/tag/v0.1.13)
* Fix cross device link during install

### [0.1.12](https://github.com/aquanauts/ozy/releases/tag/v0.1.12)
* Mostly a test of the release process post deletion of python code
* Changes to version output.
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ fn symlink_binaries(path_to_ozy: &std::path::PathBuf, config: &serde_yaml::Mappi
// If this binary isn't installed in the correct location, move it there
let expected_path_to_ozy = files::get_ozy_bin_dir()?.join("ozy");
if path_to_ozy != &expected_path_to_ozy {
std::fs::rename(path_to_ozy, expected_path_to_ozy)?;
// attempt to rename (same filesystem), but fall back to copy and remove (different filesystem)
match std::fs::rename(path_to_ozy, expected_path_to_ozy.clone()) {
Ok(_) => {},
Err(_) => {
std::fs::copy(path_to_ozy, expected_path_to_ozy)?;
std::fs::remove_file(path_to_ozy)?;
},
}
}

let app_configs = match config.get("apps") {
Expand Down

0 comments on commit 276bf45

Please sign in to comment.