Skip to content

Commit 9a58b06

Browse files
committed
script: correctly ignore exitings links and handle readonly state file
1 parent da68aac commit 9a58b06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nix/module.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
function symlink() {
3333
if [[ -e "$2" && ! -L "$2" ]] ; then
3434
echo "$2 exists and is not a symlink. Ignoring it." >&2
35-
return 1
35+
return 0
3636
fi
3737
# prevents ln failing for symlinks that are directories
3838
if [[ -d "$2" ]] ; then
@@ -47,7 +47,7 @@
4747
if [[ -d "$1" ]] ; then
4848
if [[ ! -L "$1" ]] ; then
4949
echo "$1 exists and is not a symlink. Ignoring it." >&2
50-
return 1
50+
return 0
5151
fi
5252
STORE_PATH=$(realpath "$1")
5353
rm "$1"
@@ -67,7 +67,7 @@
6767
else replaceFiles
6868
}
6969
70-
echo 1 > "$IMPURE_ACTIVE_FILE"
70+
echo 1 > "$IMPURE_ACTIVE_FILE" || echo "[INFO] Unable to write to $IMPURE_ACTIVE_FILE"
7171
''
7272
+ (optionalString (cfg.dotsDir != "") ''
7373
echo ""

0 commit comments

Comments
 (0)