-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Gundars/development
Updated install script
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# Install other scripts from this directory to system | ||
# Usage: git clone https://github.com/Gundars/bashscripts.git ~/.bashscripts && sudo bash install.sh | ||
|
||
git pull origin master | ||
SCRIPTS=( gcobranch gitmerge guorigin ) | ||
for SCRIPT in ${SCRIPTS[@]} | ||
do | ||
if [ ! -f /usr/local/bin/${SCRIPT} ]; then | ||
echo "Installing $SCRIPT" | ||
sudo ln -s ~/.bashscripts/${SCRIPT}.sh /usr/local/bin/${SCRIPT} | ||
else | ||
SYMLINK=$(readlink -f /usr/local/bin/${SCRIPT}) | ||
if [[ $SYMLINK != ~/.bashscripts/${SCRIPT}.sh ]]; then | ||
echo "Relinking existing $SCRIPT" | ||
sudo rm /usr/local/bin/${SCRIPT} | ||
sudo ln -s ~/.bashscripts/${SCRIPT}.sh /usr/local/bin/${SCRIPT} | ||
else | ||
echo "$SCRIPT already installed" | ||
fi | ||
fi | ||
done |