fix patrone

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-05-18 20:30:16 -04:00
parent e2b9f384bf
commit 565949cec2
1 changed files with 3 additions and 2 deletions

View File

@ -223,9 +223,10 @@ impl Client {
creds.access_token = rg.access_token; creds.access_token = rg.access_token;
creds.refresh_token = rg.refresh_token; creds.refresh_token = rg.refresh_token;
let p = Path::new(".patreon.json"); let mut p = dirs::home_dir().unwrap_or(".".into());
p.push(".patreon.json");
if p.exists() { if p.exists() {
fs::remove_file(p)?; fs::remove_file(&p)?;
} }
let mut fout = fs::File::create(p)?; let mut fout = fs::File::create(p)?;
serde_json::to_writer(&mut fout, &creds)?; serde_json::to_writer(&mut fout, &creds)?;