Skip to content

Commit

Permalink
files: avoid surprises when linking files (nix-community#3018)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncfavier authored and 15cm committed Feb 9, 2023
1 parent be025cb commit 9a77f0a
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 9a77f0a

Please sign in to comment.