Skip to content

Commit

Permalink
fix: global ensure manifest dir exists
Browse files Browse the repository at this point in the history
Should resolve the issue described in prefix-dev#342 (comment)
  • Loading branch information
Hofer-Julian committed Oct 1, 2024
1 parent b1197e0 commit 5ff48a4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/global/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ impl Project {
let env_root = EnvRoot::from_env().await?;

if !manifest_path.exists() {
tokio_fs::create_dir_all(&manifest_dir)
.await
.into_diagnostic()?;

let prompt = format!(
"{} You don't have a global manifest yet.\n\
Do you want to create one based on your existing installation?\n\
Expand All @@ -268,15 +272,11 @@ impl Project {
.wrap_err_with(|| {
"Failed to create global manifest from existing installation"
});
} else {
tokio_fs::File::create(&manifest_path)
.await
.into_diagnostic()?;
}

tokio_fs::create_dir_all(&manifest_dir)
.await
.into_diagnostic()?;

tokio_fs::File::create(&manifest_path)
.await
.into_diagnostic()?;
}

Self::from_path(&manifest_path, env_root, bin_dir)
Expand Down

0 comments on commit 5ff48a4

Please sign in to comment.