Migration tools #89

Merged
lucas merged 4 commits from feat/mod-migration into master 2023-03-28 21:13:57 +02:00
Showing only changes of commit 2014c3b187 - Show all commits

View file

@ -309,6 +309,12 @@ pub(crate) async fn run(_ctx: sdk::Context, matches: &ArgMatches) -> Result<()>
let out_dir = out_dir.join(&mod_file.id);
fs::create_dir(&out_dir)
.await
.wrap_err_with(|| format!("Failed to create mod directory '{}'", out_dir.display()))?;
tracing::info!("Created mod directory '{}'", out_dir.display());
println!(
"Enter additional information about your mod '{}'!",
&mod_file.id
@ -348,15 +354,6 @@ pub(crate) async fn run(_ctx: sdk::Context, matches: &ArgMatches) -> Result<()>
tracing::debug!(?dtmt_cfg);
fs::create_dir(&dtmt_cfg.dir).await.wrap_err_with(|| {
format!(
"Failed to create mod directory '{}'",
dtmt_cfg.dir.display()
)
})?;
tracing::info!("Created mod directory '{}'", dtmt_cfg.dir.display());
{
let path = dtmt_cfg.dir.join("dtmt.cfg");
let data = serde_sjson::to_string(&dtmt_cfg).wrap_err("Failed to serialize dtmt.cfg")?;