Skip to content

Instantly share code, notes, and snippets.

@nmicht
Last active January 26, 2018 18:41
Show Gist options
  • Save nmicht/2021b7e5763ded655af65b4ed20a32cd to your computer and use it in GitHub Desktop.
Save nmicht/2021b7e5763ded655af65b4ed20a32cd to your computer and use it in GitHub Desktop.
Script to checkout a list of "repos" to certain branch, pull changes and run grunt.

Checkout, pull and run grunt

  1. Copy this bash into your /usr/local/bin folder
  2. Assign execution permissions
  3. Create another file named repos.txt
  4. In repos.txt list with full path each of the repos you want to be part
  5. Update the bash with the full path to your repos.txt file
#!/bin/bash
BRANCH=${1-develop}
while read p; do
echo "▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ $p ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇"
cd "$p" &&
git reset --hard &&
git checkout $BRANCH &&
git pull &&
grunt
done < repos.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment