Move scripts

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-19 12:47:36 +00:00
parent 84a7667097
commit a92c8e59df
6 changed files with 6 additions and 7 deletions

38
lib/scripts/update.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
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