Implement non-bundled mods #125
3 changed files with 13 additions and 1 deletions
|
@ -384,7 +384,10 @@ pub(crate) async fn import_mod(state: ActionState, info: FileInfo) -> Result<Mod
|
||||||
.mods_id(id)
|
.mods_id(id)
|
||||||
.await
|
.await
|
||||||
.wrap_err_with(|| format!("Failed to query mod {} from Nexus", id))?;
|
.wrap_err_with(|| format!("Failed to query mod {} from Nexus", id))?;
|
||||||
Some(NexusInfo::from(mod_info))
|
let info = NexusInfo::from(mod_info);
|
||||||
|
|
||||||
|
tracing::debug!("{:?}", info);
|
||||||
|
Some(info)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,6 +411,7 @@ impl AppDelegate<State> for Delegate {
|
||||||
state.config_path = Arc::new(config.path);
|
state.config_path = Arc::new(config.path);
|
||||||
state.data_dir = Arc::new(config.data_dir);
|
state.data_dir = Arc::new(config.data_dir);
|
||||||
state.game_dir = Arc::new(config.game_dir.unwrap_or_default());
|
state.game_dir = Arc::new(config.game_dir.unwrap_or_default());
|
||||||
|
state.nexus_api_key = Arc::new(config.nexus_api_key.unwrap_or_default());
|
||||||
state.is_io_enabled = config.unsafe_io;
|
state.is_io_enabled = config.unsafe_io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,9 @@ where
|
||||||
.wrap_err_with(|| format!("Invalid config file {}", path.display()))?;
|
.wrap_err_with(|| format!("Invalid config file {}", path.display()))?;
|
||||||
|
|
||||||
cfg.path = path;
|
cfg.path = path;
|
||||||
|
|
||||||
|
tracing::debug!("Read config file '{}': {:?}", cfg.path.display(), cfg);
|
||||||
|
|
||||||
Ok(cfg)
|
Ok(cfg)
|
||||||
}
|
}
|
||||||
Err(err) if err.kind() == ErrorKind::NotFound => {
|
Err(err) if err.kind() == ErrorKind::NotFound => {
|
||||||
|
@ -133,6 +136,11 @@ where
|
||||||
.wrap_err_with(|| format!("Failed to read config file {}", path.display()))?;
|
.wrap_err_with(|| format!("Failed to read config file {}", path.display()))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracing::debug!(
|
||||||
|
"Config file not found at '{}', creating default.",
|
||||||
|
path.display()
|
||||||
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
let parent = default_path
|
let parent = default_path
|
||||||
.parent()
|
.parent()
|
||||||
|
|
Loading…
Add table
Reference in a new issue