Skip to content

Commit

Permalink
[Fix]: Use $XDG_DATA_HOME/graveyard instead of $XDG_DATA_HOME/tmp/gra…
Browse files Browse the repository at this point in the history
…veyard
  • Loading branch information
Siborgium authored and nivekuil committed Feb 28, 2020
1 parent f222a77 commit d24fe6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ Send files to the graveyard (/tmp/graveyard-$USER by default) instead of unlinki
let _graveyard: Cow<str> = match _graveyard_opts {
(Some(flag), _, _) => flag.into(),
(_, Ok(env), _) => env.into(),
(_, _, Ok(env)) => format!("{}{}", env, GRAVEYARD).into(),
(_, _, Ok(mut env)) => {
if !env.ends_with(std::path::MAIN_SEPARATOR) {
env.push(std::path::MAIN_SEPARATOR);
}
env.push_str("graveyard");
env.into()
},
_ => format!("{}-{}", GRAVEYARD, get_user()).into(),
};
let graveyard = Path::new(&*_graveyard);
Expand Down

0 comments on commit d24fe6d

Please sign in to comment.