Skip to content

Commit

Permalink
Merge pull request #10 from seokho-son/main
Browse files Browse the repository at this point in the history
Add script to update tumblebug-submodule by tag
  • Loading branch information
seokho-son authored Oct 31, 2023
2 parents 19e60a8 + e459fd5 commit 5883995
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions update-tumblebug-submodule.sh
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"

0 comments on commit 5883995

Please sign in to comment.