Move launcher working directory to standard location (#31)

* Move launcher working directory to standard location

* Fix settings save, attempt to get better backtraces

* Add environment variable for settings path
This commit is contained in:
Danielle
2022-04-10 13:14:53 -07:00
committed by GitHub
parent a20f6596ce
commit 8935d0e56c
6 changed files with 31 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
use eyre::Result;
use futures::TryFutureExt;
use paris::*;
mod subcommands;
@@ -16,12 +17,8 @@ async fn main() -> Result<()> {
let args = argh::from_env::<Args>();
theseus::init().await?;
let res = args.dispatch().await;
if res.is_err() {
error!("An error has occurred!\n");
} else {
theseus::save().await?;
}
res
args.dispatch()
.inspect_err(|_| error!("An error has occurred!\n"))
.and_then(|_| async { Ok(theseus::save().await?) })
.await
}