Added Lerna
This commit is contained in:
7
lerna.json
Normal file
7
lerna.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"version": "independent"
|
||||
}
|
||||
Submodule packages/sampadak updated: bdbab37c4b...4e11f29b0b
31
submodule-branch-update.sh
Executable file
31
submodule-branch-update.sh
Executable 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."
|
||||
Reference in New Issue
Block a user