From e204add2f6900d93a1d3ba6536f371c619eae614 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 May 2024 11:13:44 +0200 Subject: remove channel root more carefully (could be a symlink) --- bin/home-manager | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin') 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 -- cgit 1.4.1