Skip to content

Commit

Permalink
Merge pull request #1 from Gundars/development
Browse files Browse the repository at this point in the history
Updated install script
  • Loading branch information
Gundars committed Jan 10, 2015
2 parents 619b8c6 + 8b108ae commit 9919d2e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ Collection of bash scripts
###Installation
Execute following line in bash shell as a user:
```
git clone https://github.com/Gundars/bashscripts.git ~/.bashscripts && sudo ln -s ~/.bashscripts/gcobranch.sh /usr/local/bin/gcobranch && sudo chmod 0744 /usr/local/bin/gcobranch && sudo ln -s ~/.bashscripts/gitmerge.sh /usr/local/bin/gitmerge && sudo chmod 0744 /usr/local/bin/gitmerge && sudo ln -s ~/.bashscripts/guorigin.sh /usr/local/bin/guorigin && sudo chmod 0744 /usr/local/bin/guorigin
git clone https://github.com/Gundars/bashscripts.git ~/.bashscripts && bash install.sh
```
To update existing scripts run
```
bash ~/.bashscripts/install.sh
```

###gcobranch
Checks out and pulls specified git {branch} in all git repos found in each of specified directories {dir}
Checks out and pulls specified git branch {branch} in all git repos found in each of specified directories {dir}

Syntax: `$ gcobranch {branch} {dir1} [{dir2} {dir3}...]`

###gitmerge
Merges current branch with {branch}, pushes changes to origin. If no {branch} is specified, "development" is used
Merges current branch with branch {branch}, pushes changes to origin. If no {branch} is specified, "development" is used

Syntax: `$ gitmerge [options] [branch]`

Expand Down
Empty file removed gcobranch
Empty file.
22 changes: 22 additions & 0 deletions install.sh
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

0 comments on commit 9919d2e

Please sign in to comment.