mirror of
https://github.com/tomru/DotfilesOld.git
synced 2026-03-03 06:27:21 +01:00
use GNU stow for setup
This commit is contained in:
24
setup.sh
24
setup.sh
@@ -1,28 +1,8 @@
|
||||
INSTALL_DIR=~/.dotfiles
|
||||
TARGET_DIR=$HOME
|
||||
|
||||
for ITEM in `ls $INSTALL_DIR` ; do
|
||||
|
||||
if [ "$ITEM" = "setup.sh" ]
|
||||
then
|
||||
continue;
|
||||
fi
|
||||
|
||||
TARGET_NAME="$TARGET_DIR/.$ITEM";
|
||||
|
||||
# backup needed
|
||||
if [ -f $TARGET_NAME ] || [ -h $TARGET_NAME ] || [ -d $TARGET_NAME ]
|
||||
then
|
||||
echo "Found $TARGET_NAME. Backing up to ${TARGET_NAME}.pre_dotfiles";
|
||||
mv $TARGET_NAME ${TARGET_NAME}.pre_dotfiles || exit 1
|
||||
fi
|
||||
|
||||
ln -s $INSTALL_DIR/$ITEM $TARGET_NAME;
|
||||
echo "Genereated symbolic link from $TARGET_NAME to $INSTALL_DIR/$ITEM";
|
||||
echo ""
|
||||
|
||||
|
||||
done
|
||||
cd $INSTALL_DIR
|
||||
|
||||
stow $(ls -d */ | xargs basename --multiple)
|
||||
echo 'dotfiles are installed'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user