Skip to content

Commit

Permalink
fix directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Jun 8, 2024
1 parent e5f25cd commit d346456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/dojo-world/src/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ impl BaseManifest {

impl OverlayManifest {
pub fn load_from_path(path: &Utf8PathBuf) -> Result<Self, AbstractManifestError> {
fs::create_dir_all(path)?;

let mut world: Option<OverlayClass> = None;

let world_path = path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml");
Expand Down Expand Up @@ -184,7 +186,7 @@ impl OverlayManifest {
/// - `world` and `base` manifest are written to root of the folder.
/// - `contracts` and `models` are written to their respective directories.
pub fn write_to_path_nested(&self, path: &Utf8PathBuf) -> Result<(), AbstractManifestError> {
fs::create_dir_all(path.parent().unwrap())?;
fs::create_dir_all(path)?;

Check warning on line 189 in crates/dojo-world/src/manifest/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/dojo-world/src/manifest/mod.rs#L188-L189

Added lines #L188 - L189 were not covered by tests

if let Some(ref world) = self.world {
let world = toml::to_string(world)?;
Expand Down

0 comments on commit d346456

Please sign in to comment.