Skip to content

Commit

Permalink
Run mkpath also in write_manifest
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
fredrikekre authored and KristofferC committed Jan 8, 2025
1 parent 3f78234 commit abdae83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/manifest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/project.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand All @@ -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

0 comments on commit abdae83

Please sign in to comment.