diff --git a/shell/up.sh b/shell/up.sh new file mode 100755 index 0000000..0f0cacd --- /dev/null +++ b/shell/up.sh @@ -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