mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 22:55:10 +01:00
Exit when target directory does not exist on cd
This commit is contained in:
14
install.sh
14
install.sh
@@ -7,7 +7,7 @@ install_hg()
|
|||||||
touch ~/.dot_has_hg
|
touch ~/.dot_has_hg
|
||||||
HGDIR=~/workspace/application_addons/mercurial
|
HGDIR=~/workspace/application_addons/mercurial
|
||||||
mkdir -p $HGDIR
|
mkdir -p $HGDIR
|
||||||
cd $HGDIR
|
cd $HGDIR || exit
|
||||||
|
|
||||||
for REPO in Mekk/mercurial_keyring sjl/hg-prompt durin42/hg-git yujiewu/hgflow
|
for REPO in Mekk/mercurial_keyring sjl/hg-prompt durin42/hg-git yujiewu/hgflow
|
||||||
do
|
do
|
||||||
@@ -17,7 +17,7 @@ install_hg()
|
|||||||
hg clone http://bitbucket.org/$REPO
|
hg clone http://bitbucket.org/$REPO
|
||||||
#echo http://bitbucket.org/$REPO
|
#echo http://bitbucket.org/$REPO
|
||||||
else
|
else
|
||||||
cd $HGDIR/$REPODIR
|
cd $HGDIR/$REPODIR || exit
|
||||||
#echo $HGDIR/$REPODIR
|
#echo $HGDIR/$REPODIR
|
||||||
hg pull -u
|
hg pull -u
|
||||||
fi
|
fi
|
||||||
@@ -47,12 +47,12 @@ echo "Installing from $DIR"
|
|||||||
DATETIME=$(date +%Y%m%d_%H%M)
|
DATETIME=$(date +%Y%m%d_%H%M)
|
||||||
|
|
||||||
# Go home
|
# Go home
|
||||||
cd
|
cd || exit
|
||||||
|
|
||||||
# Symlink all the things
|
# Symlink all the things
|
||||||
for TARGET in .bash_aliases .bashrc bin .gitconfig .gitmodules .hgauthors.txt .hgignore .hgrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh
|
for TARGET in .bash_aliases .bashrc bin .gitconfig .gitmodules .hgauthors.txt .hgignore .hgrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh
|
||||||
do
|
do
|
||||||
cd
|
cd || exit
|
||||||
echo $TARGET
|
echo $TARGET
|
||||||
if [ "$(readlink $TARGET)" = "$DIR/$TARGET" ]; then
|
if [ "$(readlink $TARGET)" = "$DIR/$TARGET" ]; then
|
||||||
echo " symlink exists and is fine, skipping"
|
echo " symlink exists and is fine, skipping"
|
||||||
@@ -76,7 +76,7 @@ do
|
|||||||
# If link is in a subdir, go there
|
# If link is in a subdir, go there
|
||||||
DIRNAME=$(dirname ${TARGET})
|
DIRNAME=$(dirname ${TARGET})
|
||||||
if [ "$DIRNAME" != "." ]; then
|
if [ "$DIRNAME" != "." ]; then
|
||||||
cd "$DIRNAME"
|
cd "$DIRNAME" || exit
|
||||||
fi
|
fi
|
||||||
# Create the symlink
|
# Create the symlink
|
||||||
ln -s "$DIR/$TARGET"
|
ln -s "$DIR/$TARGET"
|
||||||
@@ -93,9 +93,9 @@ if [ ! -d "${HOME}/.vim/bundle/Vundle.vim" ]; then
|
|||||||
mkdir -p ~/.vim/bundle
|
mkdir -p ~/.vim/bundle
|
||||||
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
||||||
else
|
else
|
||||||
cd ~/.vim/bundle/Vundle.vim
|
cd ~/.vim/bundle/Vundle.vim || exit
|
||||||
git pull
|
git pull
|
||||||
cd
|
cd || exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "INFO: Vundle Install"
|
echo "INFO: Vundle Install"
|
||||||
|
|||||||
Reference in New Issue
Block a user