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

Fix cross device link during install #97

Merged
merged 1 commit into from
Dec 30, 2024
Merged
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
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