diff --git a/crates/unavi-app/build.rs b/crates/unavi-app/build.rs new file mode 100644 index 000000000..c1524fc94 --- /dev/null +++ b/crates/unavi-app/build.rs @@ -0,0 +1,7 @@ +fn main() { + // Store the target, used for self-updating. + println!( + "cargo:rustc-env=TARGET={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/crates/unavi-app/default.nix b/crates/unavi-app/default.nix index bcefeebc5..6596ae685 100644 --- a/crates/unavi-app/default.nix +++ b/crates/unavi-app/default.nix @@ -75,8 +75,6 @@ let ]; postInstall = '' - mv $out/bin/* $out - rm -r $out/bin cp -r crates/unavi-app/assets $out cp LICENSE $out ''; diff --git a/crates/unavi-app/src/update.rs b/crates/unavi-app/src/update.rs index 79018ec66..b3a06a8f0 100644 --- a/crates/unavi-app/src/update.rs +++ b/crates/unavi-app/src/update.rs @@ -11,7 +11,7 @@ pub fn check_for_updates() -> Result<()> { println!("Checking for updates..."); // Get latest GitHub release. - let target = std::env::var("TARGET")?; + let target = env!("TARGET"); let pkg = env!("CARGO_PKG_NAME"); let target = if target.contains("linux") {