diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000..21d8bcc --- /dev/null +++ b/lerna.json @@ -0,0 +1,7 @@ +{ + "packages": [ + "packages/*" + ], + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "version": "independent" +} diff --git a/packages/sampadak b/packages/sampadak index bdbab37..4e11f29 160000 --- a/packages/sampadak +++ b/packages/sampadak @@ -1 +1 @@ -Subproject commit bdbab37c4ba631fe334ab4e35cf82e2e79dbc8e6 +Subproject commit 4e11f29b0b6e608784ecbdfccf3c241f5bdb9c10 diff --git a/submodule-branch-update.sh b/submodule-branch-update.sh new file mode 100755 index 0000000..df26ee4 --- /dev/null +++ b/submodule-branch-update.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Check if the correct number of arguments is provided +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +SUBMODULE_PATH=$1 +BRANCH_NAME=$2 + +# Navigate to the main repository +cd "$(git rev-parse --show-toplevel)" + +# Set the submodule to track the specified branch +git submodule set-branch --branch "$BRANCH_NAME" "$SUBMODULE_PATH" + +# Update the submodule to the latest commit on the specified branch +git submodule update --remote "$SUBMODULE_PATH" + +# Navigate into the submodule and check out the specified branch +cd "$SUBMODULE_PATH" +git checkout "$BRANCH_NAME" +cd - + +# Commit the changes to the main repository +git add .gitmodules "$SUBMODULE_PATH" +git commit -m "Update submodule $SUBMODULE_PATH to track $BRANCH_NAME branch" +git push origin main + +echo "Submodule $SUBMODULE_PATH is now tracking the $BRANCH_NAME branch." \ No newline at end of file