Skip to content

Instantly share code, notes, and snippets.

@z3ntu
Created December 31, 2015 12:31
Show Gist options
  • Save z3ntu/d0bab1879895b5a12abc to your computer and use it in GitHub Desktop.
Save z3ntu/d0bab1879895b5a12abc to your computer and use it in GitHub Desktop.
Script for updating programs with the source code from git repositories.
#!/bin/bash
# Script by github.com/z3ntu
for dir in */; do
echo "Updating $dir."
cd $dir
output="$(git pull)"
if [ "$output" != 'Already up-to-date.' ]; then
if [ -x "build.sh" ]; then
echo "Running buid.sh."
./build.sh
else
echo "build.sh was not found in subdirectory $dir"
fi
else
echo "Already up-to date."
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment