Update grs.sh

This commit is contained in:
Mohammed Goder 2024-03-23 15:49:23 -05:00
parent 949ff63c33
commit dfb8d36aa4

13
grs.sh
View File

@ -23,10 +23,21 @@ for repository in *; do
gitOutput=$(git pull --recurse-submodules=on-demand) gitOutput=$(git pull --recurse-submodules=on-demand)
echo "$gitOutput" echo "$gitOutput"
cd .. cd ..
if [ "$gitOutput" == "Already up to date." ] || [ "$gitOutput" == "" ]; then continue; fi if [ "$gitOutput" == "Already up to date." ]; then continue; fi
cd .. cd ..
echo "$log" >> "$logPath" echo "$log" >> "$logPath"
if [ "$gitOutput" == "" ]; then
log=$(echo [$(date +"%Y-%m-%d %H:%M:%S")] Unable to check for updates to \"$repository\")
echo "$log"
echo "$log" >> "$logPath"
echo >> "$logPath"
cd repositories
continue;
fi
echo "$gitOutput" >> "$logPath" echo "$gitOutput" >> "$logPath"
snapshotSize=$(($(du -sb "snapshots/$repository" | cut -f1) - $(du -sb "snapshots/$repository/.git" | cut -f1))) snapshotSize=$(($(du -sb "snapshots/$repository" | cut -f1) - $(du -sb "snapshots/$repository/.git" | cut -f1)))