Skip to content

Commit

Permalink
files: avoid surprises when linking files (#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncfavier authored Jan 9, 2023
1 parent 4f0c1af commit 69806e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ in
$VERBOSE_ECHO "Skipping '$targetPath' as it is identical to '$sourcePath'"
else
# Place that symlink, --force
# This can still fail if the target is a directory, in which case we bail out.
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1
fi
done
'';
Expand Down

0 comments on commit 69806e9

Please sign in to comment.