Skip to content
Snippets Groups Projects
Commit 5c8c89b2 authored by xo30xoqa's avatar xo30xoqa
Browse files

Fixed git related error in saveinputdata()

parent 622a5e79
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,11 @@ settings used. This allows replicating a run in future. ...@@ -88,7 +88,11 @@ settings used. This allows replicating a run in future.
function saveinputfiles(model::SimulationModel) function saveinputfiles(model::SimulationModel)
#XXX If this is a parallel run, we should save the global config to the top-level #XXX If this is a parallel run, we should save the global config to the top-level
# output directory # output directory
currentcommit = read(`git rev-parse HEAD`, String)[1:8] try # if this is loaded as a package, the directory may not be a git repo
currentcommit = read(`git rev-parse HEAD`, String)[1:8]
catch
currentcommit = "********"
end
mkpath(joinpath(@param(core.outdir), RECORDDIR)) mkpath(joinpath(@param(core.outdir), RECORDDIR))
open(joinpath(@param(core.outdir), RECORDDIR, basename(@param(core.configfile))), "w") do f open(joinpath(@param(core.outdir), RECORDDIR, basename(@param(core.configfile))), "w") do f
println(f, "#\n# --- Persefone configuration parameters ---") println(f, "#\n# --- Persefone configuration parameters ---")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment