fs: ensure-file: don't error if the file already exists

This commit is contained in:
Colin 2024-02-23 11:24:52 +00:00
parent 5b8f13d9cc
commit af2f97d61e
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ cpOverwrite() {
cpNoOverwrite() {
# --no-dereference in case the destination already exists as a symlink.
# it will still follow directory-level intermediate symlinks: just not a leaf symlink
cp --no-clobber --no-dereference "$cpfrom" "$cpto"
cp --no-clobber --no-dereference "$cpfrom" "$cpto" || test -f "$cpto"
}
cpNoOverwrite