mirror of
https://github.com/Ascyii/scripts.git
synced 2026-01-01 04:44:24 -05:00
auto up 23:20:55 up 1:52, 2 users, load average: 1.80, 1.92, 1.80
This commit is contained in:
27
shell/up.sh
Executable file
27
shell/up.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# List of directories with git repositories
|
||||
REPOS=(
|
||||
"/home/jonas/nixos"
|
||||
"/home/jonas/dotfiles"
|
||||
"/home/jonas/.config/nvim"
|
||||
"/home/jonas/projects/scripts"
|
||||
"/home/jonas/projects/university"
|
||||
)
|
||||
|
||||
# Commit message
|
||||
COMMIT_MSG="auto up $(uptime)"
|
||||
|
||||
for repo in "${REPOS[@]}"; do
|
||||
if [ -d "$repo/.git" ]; then
|
||||
echo "Processing $repo..."
|
||||
cd "$repo" || continue
|
||||
git fetch
|
||||
git add .
|
||||
git commit -m "$COMMIT_MSG"
|
||||
git pull --rebase
|
||||
git push
|
||||
else
|
||||
echo "Skipping $repo: not a git repository"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user