From 9d80a90fc1f6d2f67c728681840b95a44dcc8704 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Jun 2008 17:10:52 +0200 Subject: Now automatically populating ~/bin --- bin/pkg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index e75fe1c..b5ee520 100755 --- a/bin/pkg +++ b/bin/pkg @@ -216,8 +216,9 @@ populate_collected () { clear_line if ([ -d bin ]) { for i in bin/*(*); { - if ([ ! -e $PDIR/.collected/$i ]) { - ln -s ../../$1/$i $PDIR/.collected/$i + if ([ -l "$HOME/$i" -a "$(readlink $HOME/$i)" != "../$1/$i" ]) { + rm -f "$HOME/$i" + ln -s ../${PDIR//$HOME\/}/$1/$i $HOME/$i } } } @@ -246,8 +247,8 @@ genocide_collected () { clear_line if ([ -d bin ]) { for i in bin/*(*); { - if ([ "$(readlink $PDIR/.collected/$i)" = "../../$1/$i" ]) { - rm -f $PDIR/.collected/$i + if ([ "$(readlink $HOME/$i)" = "../$1/$i" ]) { + rm -f $HOME/$i } } } -- cgit v1.2.3