1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Assert existence of config file's parent directory

Fixes TheLocehiliosan/yadm#226

When a config file path is passed to yadm whose parent directory does
not exist, git (and hence yadm) fails without writing the file.
Yadm should, however, make sure that the directory exists s.t. git can
just write to the file.
This commit is contained in:
jonasc
2020-06-01 19:37:43 +02:00
committed by Tim Byrne
parent 550a6b4340
commit 60b23e33e8
2 changed files with 26 additions and 0 deletions

2
yadm
View File

@@ -849,6 +849,8 @@ EOF
CHANGES_POSSIBLE=1
else
# make sure parent folder of config file exists
assert_parent "$YADM_CONFIG"
# operate on the yadm configuration file
"$GIT_PROGRAM" config --file="$(mixed_path "$YADM_CONFIG")" "$@"