forked from cadey/xesite
blow up without patrone
Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
parent
3a4827c887
commit
ea8e1e045a
|
@ -125,18 +125,14 @@ pub struct Links {
|
||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
pub fn new() -> Result<Self> {
|
pub fn new() -> Result<Self> {
|
||||||
let mut creds = Credentials::default();
|
|
||||||
|
|
||||||
let p = Path::new(".patreon.json");
|
let p = Path::new(".patreon.json");
|
||||||
if p.exists() {
|
let config = fs::read_to_string(p)?;
|
||||||
let config = fs::read_to_string(p)?;
|
let creds: Credentials = serde_json::from_str(&config)?;
|
||||||
creds = serde_json::from_str(&config)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
cli: reqwest::Client::new(),
|
cli: reqwest::Client::new(),
|
||||||
base_url: "https://api.patreon.com".into(),
|
base_url: "https://api.patreon.com".into(),
|
||||||
creds: creds,
|
creds,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue