Compare commits

..
Author SHA1 Message Date
Renovate Bot eb4f3356ac Add renovate.json 2024-05-07 22:56:26 +00:00
Code002Lover 96cb053e65 factor out token path 2024-01-01 19:00:11 +01:00
2 changed files with 12 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}
+6 -2
View File
@@ -21,13 +21,17 @@ struct Saved {
errorcode: u64,
}
pub fn get_token_path() -> String {
get_ipass_folder() + "token.ipasst"
}
fn get_token() -> Option<String> {
let mut token: String = String::new();
//check if file exists
if !std::path::Path::new(&(get_ipass_folder() + "token.ipasst")).exists() {
if !std::path::Path::new(&get_token_path()).exists() {
return None;
}
File::open(get_ipass_folder() + "token.ipasst")
File::open(get_token_path())
.unwrap()
.read_to_string(&mut token)
.unwrap();