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 spacekookie committed Feb 10, 2023
1 parent 4d7fb39 commit 281921a
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 281921a

Please sign in to comment.