Skip to content

Instantly share code, notes, and snippets.

@ArnaudD
Last active April 13, 2016 09:29
Show Gist options
  • Save ArnaudD/40f153aa93920bd56f90 to your computer and use it in GitHub Desktop.
Save ArnaudD/40f153aa93920bd56f90 to your computer and use it in GitHub Desktop.
scripts for managing several repositories

install

sudo apt-get install parallel
bash <(curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/update-scripts.sh)
#!/bin/bash
parallel --no-notice git -C ::: `ls fizix-* -d` ::: fetch
BOLD='\e[1m'
BLUE='\e[34m'
YELLOW='\e[93m'
RESET='\e[0m'
for dir in `ls */ -d`; do
branch=$(git -C $dir symbolic-ref --short -q HEAD)
echo -e "$BOLD$BLUE$dir $YELLOW($branch)$RESET"
# git -C $dir status
git -C $dir merge --ff-only
done
#!/bin/bash
parallel --no-notice git -C ::: `ls fizix-* -d` ::: push
#!/bin/bash
node_projects=`ls fizix-*/package.json | xargs dirname`
parallel --no-notice npm --prefix ::: $node_projects ::: install
#!/bin/bash
node_projects=`ls fizix-*/package.json | xargs dirname`
packages=`ls */node_modules/@fizix/* -d | xargs basename -a | sort | uniq | sed 's/^/\@fizix\//'`
parallel --eta --no-notice npm --prefix ::: $node_projects ::: update ::: $packages
#!/bin/bash
curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/git-pull.sh > git-pull.sh
curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/git-push.sh > git-push.sh
curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/npm-install.sh > npm-install.sh
curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/update-scripts.sh > update-scripts.sh
curl -s https://gist.githubusercontent.com/ArnaudD/40f153aa93920bd56f90/raw/npm-update.sh > npm-update.sh
chmod u+x *.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment