Added Lerna

This commit is contained in:
2024-09-05 14:04:16 +05:30
parent 5d0d5e95d7
commit 6a77d853b3
3 changed files with 39 additions and 1 deletions

7
lerna.json Normal file
View File

@@ -0,0 +1,7 @@
{
"packages": [
"packages/*"
],
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent"
}

31
submodule-branch-update.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <submodule-path> <branch-name>"
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."