mirror of
https://github.com/mrfluffy-dev/kami.git
synced 2026-01-17 04:50:32 +00:00
fixed config dir problem
This commit is contained in:
@@ -13,18 +13,15 @@ pub fn get_token() -> String {
|
|||||||
if !token_path.exists() {
|
if !token_path.exists() {
|
||||||
//create empty file
|
//create empty file
|
||||||
fs::File::create(&token_path).unwrap();
|
fs::File::create(&token_path).unwrap();
|
||||||
} else {
|
}
|
||||||
//read token from file
|
//read token from file
|
||||||
let token = fs::read_to_string(&token_path).unwrap();
|
let token = fs::read_to_string(&token_path).unwrap();
|
||||||
if token.is_empty() {
|
if token.is_empty() {
|
||||||
println!("please go to the below link and copy and past the token below");
|
println!("please go to the below link and copy and past the token below");
|
||||||
println!(
|
println!("https://anilist.co/api/v2/oauth/authorize?client_id=9121&response_type=token");
|
||||||
"https://anilist.co/api/v2/oauth/authorize?client_id=9121&response_type=token"
|
|
||||||
);
|
|
||||||
let token = string_input("token: ");
|
let token = string_input("token: ");
|
||||||
fs::write(&token_path, token).unwrap();
|
fs::write(&token_path, token).unwrap();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
let token = fs::read_to_string(&token_path).unwrap();
|
let token = fs::read_to_string(&token_path).unwrap();
|
||||||
token
|
token
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user