Update grs.sh

This commit is contained in:
Mohammed Goder 2024-03-24 00:27:45 -05:00
parent 6cfd44b100
commit 926c83cbd7

24
grs.sh
View File

@ -29,13 +29,25 @@ for repository in *; do
echo "$log" >> "$logPath" echo "$log" >> "$logPath"
if [ "$gitOutput" == "" ]; then if [ "$gitOutput" == "" ]; then
log=$(echo [$(date +"%Y-%m-%d %H:%M:%S")] Unable to check for updates to \"$repository\") cd "repositories/$repository"
echo "$log" gitURL=$(git config --get remote.origin.url)
echo "$log" >> "$logPath" cd ..
echo >> "$logPath" rm -rf "$repository"
gitOutput=$(git clone --recursive $gitURL)
cd ..
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 cp -rf "snapshots/$repository" repositories
continue;
cd repositories
continue;
fi
echo "$gitOutput"
fi fi
echo "$gitOutput" >> "$logPath" echo "$gitOutput" >> "$logPath"