Skip to content

Instantly share code, notes, and snippets.

@nmicht
Last active Jan 26, 2018
Embed
What would you like to do?
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