Last active
March 3, 2020 19:42
-
-
Save Thermoflux/d6ba0051a48cef0f753c7fb68cd8069d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################ | |
# Use this script to update the repositories in directory 'REPOSITORIES' | |
################ | |
# Uncomment if you want the script to always use the scripts | |
# directory as the folder to look through | |
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
REPOSITORIES="/home/rstudio/ForteAegis/Code/" | |
IFS=$'\n' | |
for REPO in `ls "$REPOSITORIES/"` | |
do | |
if [ -d "$REPOSITORIES/$REPO" ] | |
then | |
echo "Updating $REPOSITORIES/$REPO at `date`" | |
if [ -d "$REPOSITORIES/$REPO/.git" ] | |
then | |
cd "$REPOSITORIES/$REPO" | |
git status | |
echo "Fetching" | |
git fetch | |
echo "Pulling" | |
git pull | |
else | |
echo "Skipping because it doesn't look like it has a .git folder." | |
fi | |
echo "Done at `date`" | |
echo | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment