-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to update tumblebug-submodule by tag
- Loading branch information
1 parent
cbb41fe
commit e459fd5
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
cd cb-tumblebug || { echo "Error: Failed to enter cb-tumblebug directory."; exit 1; } | ||
|
||
# Fetch all tags from the remote repository | ||
git fetch --tags | ||
|
||
# Sort and display the list of available tags and get user input | ||
echo "[Available tags in CB-Tumblebug]" | ||
git tag -l | sort -V | ||
echo "[Select a tag to checkout]" | ||
read -r TARGET_TAG | ||
|
||
# Checkout to the tag specified by the user | ||
git checkout tags/$TARGET_TAG | ||
if [ $? -ne 0 ]; then | ||
echo "Error: Failed to checkout tag $TARGET_TAG" | ||
exit 1 | ||
fi | ||
|
||
# Navigate back to the parent directory | ||
cd .. | ||
|
||
# Stage the changes | ||
git add -u | ||
|
||
# Create a commit | ||
git commit -m "Update Submodule CB-Tumblebug $TARGET_TAG" | ||
|
||
echo "CB-Tumblebug successfully updated to $TARGET_TAG" | ||
echo "ToDo: git log" | ||
echo "ToDo: git push origin" | ||
|