Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,40 @@ BRANCH=${2:-dev}
FLAGS=${@:3}

# 1. Update the amech-dev repo
git checkout main
git pull https://github.com/Auto-Mech/amech-dev
pixi self-update
pixi install

# 2. Loop through each repo and update
echo "Execute the following commands in each repository?"
echo "The following commands will be run in each repository:"
echo " git checkout ${BRANCH}"
echo " git pull --rebase ${REMOTE} ${BRANCH}"
echo " git push ${FLAGS} origin ${BRANCH}"
read -p "Press enter to confirm "

for repo in ${REPOS[@]}
do
printf "\n*** Updating in ${DIR}/src/${repo} ***\n"
(
cd ${DIR}/src/${repo} && \
git checkout ${BRANCH} && \
git pull --rebase ${REMOTE} ${BRANCH} && \
git push ${FLAGS} origin ${BRANCH}
)
printf "******\n"
done
read -p "Is this what you want to do? [y/n] " yn

if [[ $yn =~ ^[Yy]$ ]]; then
for repo in ${REPOS[@]}
do
printf "\n*** Updating in ${DIR}/src/${repo} ***\n"
(
cd ${DIR}/src/${repo} && \
git checkout ${BRANCH} && \
git pull --rebase ${REMOTE} ${BRANCH} && \
git push ${FLAGS} origin ${BRANCH}
)
printf "******\n"
done
fi

if git config --get remote.origin.url | grep -i Auto-Mech > /dev/null; then
echo "No fork of amech-dev found. Not attempting to push amech-dev."
else
echo "You appear to be working on a fork of amech-dev."
read -p "Do you want to push amech-dev changes to your fork? [y/n] " yn
if [[ $yn =~ ^[Yy]$ ]]; then
git push origin
fi
fi

git checkout -
Loading