mirror of
https://github.com/Ascyii/scripts.git
synced 2026-01-01 04:44:24 -05:00
auto up 00:00:12 up 0:08, 2 users, load average: 1.56, 0.92, 0.48
This commit is contained in:
23
shell/up.sh
23
shell/up.sh
@@ -12,19 +12,28 @@ REPOS=(
|
|||||||
# Commit message
|
# Commit message
|
||||||
COMMIT_MSG="auto up $(uptime)"
|
COMMIT_MSG="auto up $(uptime)"
|
||||||
|
|
||||||
for repo in "${REPOS[@]}"; do
|
process_repo() {
|
||||||
|
local repo="$1"
|
||||||
|
|
||||||
if [ -d "$repo/.git" ]; then
|
if [ -d "$repo/.git" ]; then
|
||||||
echo "Processing $repo...
|
echo "Processing $repo..."
|
||||||
|
(
|
||||||
|
cd "$repo" || exit
|
||||||
"
|
|
||||||
cd "$repo" || continue
|
|
||||||
git fetch
|
git fetch
|
||||||
git add .
|
git add .
|
||||||
git commit -m "$COMMIT_MSG"
|
git commit -m "$COMMIT_MSG" >/dev/null 2>&1 || true
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
git push
|
git push
|
||||||
|
echo "Done: $repo"
|
||||||
|
)
|
||||||
else
|
else
|
||||||
echo "Skipping $repo: not a git repository"
|
echo "Skipping $repo: not a git repository"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for repo in "${REPOS[@]}"; do
|
||||||
|
process_repo "$repo" &
|
||||||
done
|
done
|
||||||
|
|
||||||
|
wait
|
||||||
|
echo "All repositories processed."
|
||||||
|
|||||||
Reference in New Issue
Block a user