From abdae8373b1789c216d1443df127455ea5ec2df9 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 7 Nov 2024 16:32:03 +0100 Subject: [PATCH] Run `mkpath` also in `write_manifest` Apps only write a manifest so can't rely on the path being created by `write_project`. Also moves the `mkpath` call for `write_project` to the method that actually does the filesystem writing with `write`. --- src/manifest.jl | 1 + src/project.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/manifest.jl b/src/manifest.jl index 53c67ba2b4..b8042ff312 100644 --- a/src/manifest.jl +++ b/src/manifest.jl @@ -368,6 +368,7 @@ function write_manifest(io::IO, raw_manifest::Dict) end function write_manifest(raw_manifest::Dict, manifest_file::AbstractString) str = sprint(write_manifest, raw_manifest) + mkpath(dirname(manifest_file)) write(manifest_file, str) end diff --git a/src/project.jl b/src/project.jl index 45c41a581d..a856ddafe0 100644 --- a/src/project.jl +++ b/src/project.jl @@ -275,7 +275,6 @@ project_key_order(key::String) = something(findfirst(x -> x == key, _project_key_order), length(_project_key_order) + 1) function write_project(env::EnvCache) - mkpath(dirname(env.project_file)) write_project(env.project, env.project_file) end write_project(project::Project, project_file::AbstractString) = @@ -296,5 +295,6 @@ function write_project(io::IO, project::Dict) end function write_project(project::Dict, project_file::AbstractString) str = sprint(write_project, project) + mkpath(dirname(project_file)) write(project_file, str) end