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

@@ -5,7 +5,10 @@
#![warn(unused_import_braces, missing_debug_implementations)]
static LAUNCHER_WORK_DIR: &'static str = "./launcher";
// TODO: make non-hardcoded
lazy_static::lazy_static! {
static ref LAUNCHER_WORK_DIR: std::path::PathBuf = dirs::config_dir().expect("Could not find config dir").join("theseus");
}
pub mod data;
pub mod launcher;
@@ -25,7 +28,8 @@ pub enum Error {
}
pub async fn init() -> Result<(), Error> {
std::fs::create_dir_all(LAUNCHER_WORK_DIR)
tokio::fs::create_dir_all(LAUNCHER_WORK_DIR.as_path())
.await
.expect("Unable to create launcher root directory!");
use crate::data::*;