Files
nix/scripts/update.sh
Nikolaos Karaolidis 78a862bd2e Housekeeping
- Update README
- Run shellcheck on .sh files
- Add helper scripts
- Remove eirene vm variant
- Add post-install checklist

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2024-08-23 01:22:08 +02:00

35 lines
858 B
Bash
Executable File

#!/usr/bin/env bash
paths=$(git config --file .gitmodules --name-only --get-regexp path | while read -r line; do
path=$(git config --file .gitmodules --get "${line}")
url=$(git config --file .gitmodules --get "${line%.*}.url")
if [[ ${url} == *"karaolidis"* ]]; then
echo "${path}"
fi
done)
for path in ${paths}; do
echo "Processing submodule: ${path}"
cd "${path}" || exit
git checkout master
git fetch upstream
git merge upstream/master
branches=$(git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v '^master$')
for branch in ${branches}; do
git checkout "${branch}"
git rebase master
done
git checkout integration
git push origin --all --force-with-lease
git push origin --tags --force-with-lease
cd - > /dev/null || exit
done
echo "All submodules updated successfully."
nix flake update