Skip to content

Commit

Permalink
create leading directories if they don't exist
Browse files Browse the repository at this point in the history
This works for files without directories too because `dirname` prints
`.` in that case.
  • Loading branch information
CobaltCause committed Nov 3, 2023
1 parent 0559197 commit 2fb7245
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/agenix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ function edit {

@ageBin@ "${ENCRYPT[@]}" <"$CLEARTEXT_FILE" || exit 1

mkdir -p "$(dirname $FILE)"

mv -f "$REENCRYPTED_FILE" "$FILE"
}

Expand Down

0 comments on commit 2fb7245

Please sign in to comment.