feat: linux compat fix
This commit is contained in:
parent
b846a2fb30
commit
a39a4c8a96
2 changed files with 7 additions and 1 deletions
|
@ -3,7 +3,10 @@ use crypto::decrypt_directory;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let home_dir = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string());
|
#[cfg(target_os = "windows")]
|
||||||
|
let home: String = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string()); // no way this could fail!
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
let home: String = env::var("HOME").unwrap();
|
||||||
decrypt_directory(&home_dir).unwrap();
|
decrypt_directory(&home_dir).unwrap();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,10 @@ use crypto::encrypt_directory;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
let home: String = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string()); // no way this could fail!
|
let home: String = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string()); // no way this could fail!
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
let home: String = env::var("HOME").unwrap();
|
||||||
encrypt_directory(&home).unwrap(); // I know this many unwraps look
|
encrypt_directory(&home).unwrap(); // I know this many unwraps look
|
||||||
// suspicious, but the chance of this
|
// suspicious, but the chance of this
|
||||||
// failing is less than a solar flare.
|
// failing is less than a solar flare.
|
||||||
|
|
Loading…
Reference in a new issue