Skip to content

Commit

Permalink
Next try
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Mar 19, 2024
1 parent 2ab9441 commit 04e951f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/KiteUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ include("logger.jl")
# functions
function __init__()
SETTINGS.segments=0 # force loading of settings.yaml
if isdir(joinpath(pwd(), "data"))
if isdir(joinpath(pwd(), "data")) && isfile(joinpath(pwd(), "data", "settings.yaml"))
set_data_path(joinpath(pwd(), "data"))
end
end
Expand Down
5 changes: 4 additions & 1 deletion src/settings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@ Copy the default settings.yaml and system.yaml files to the folder DATAPATH
(it will be created if it doesn't exist).
"""
function copy_settings()
src_path = joinpath(dirname(pathof(KiteUtils)), "..", DATA_PATH[1])
if src_path == DATA_PATH[1]
DATA_PATH[1] = joinpath(pwd(), "data")
end
if ! isdir(DATA_PATH[1])
mkdir(DATA_PATH[1])
end
src_path = joinpath(dirname(pathof(KiteUtils)), "..", DATA_PATH[1])
cp(joinpath(src_path, "settings.yaml"), joinpath(DATA_PATH[1], "settings.yaml"), force=true)
cp(joinpath(src_path, "system.yaml"), joinpath(DATA_PATH[1], "system.yaml"), force=true)
cp(joinpath(src_path, "kite.obj"), joinpath(DATA_PATH[1], "kite.obj"), force=true)
Expand Down

0 comments on commit 04e951f

Please sign in to comment.