summary refs log tree commit diff stats
path: root/bin/home-manager
diff options
context:
space:
mode:
authorAlan Pearce2024-05-07 11:13:44 +0200
committerAlan Pearce2024-05-18 12:17:12 +0200
commite204add2f6900d93a1d3ba6536f371c619eae614 (patch)
treeaf675feeda1f062298d80b4ea09f6d9b6ae16652 /bin/home-manager
parenta46864566b13b61bddd9b0ee15457efa288ec3de (diff)
downloadnixfiles-e204add2f6900d93a1d3ba6536f371c619eae614.tar.lz
nixfiles-e204add2f6900d93a1d3ba6536f371c619eae614.tar.zst
nixfiles-e204add2f6900d93a1d3ba6536f371c619eae614.zip
remove channel root more carefully (could be a symlink)
Diffstat (limited to 'bin/home-manager')
-rwxr-xr-xbin/home-manager8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/home-manager b/bin/home-manager
index 39ed1639..672c3403 100755
--- a/bin/home-manager
+++ b/bin/home-manager
@@ -30,8 +30,12 @@ for i in 1
         mkdir -p $hm_config_dir
     end
     if test -e $channel_root
-        rm $channel_root/* || exit 1
-        rmdir $channel_root
+        if test ! -L $channel_root
+            rm $channel_root/* || exit 1
+            rmdir $channel_root
+        else
+            rm $channel_root || exit 1
+        end
     end
 end