File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 2
2
# If no project name is given
3
3
if [ $# -eq 0 ]; then
4
4
# Display usage and stop
5
- echo " Usage: git-setup.sh <console,website>"
5
+ echo " Usage: git-setup.sh <console,website,platform >"
6
6
exit 1
7
7
fi
8
8
# Get remote url to support either https or ssh
@@ -21,11 +21,18 @@ for module in "$@"; do
21
21
git config -f .gitmodules --unset-all " submodule.apps/$module .branch"
22
22
# Add the submodule
23
23
git submodule add --force $project " apps/$module "
24
- # Set the default branch to main
25
- git config -f .gitmodules --add " submodule.apps/$module .branch" main
26
24
27
- # Update to the latest from main in that submodule
28
- cd apps/$module && git pull origin main && cd ../..
25
+ # Determine the branch based on module
26
+ branch=" main"
27
+ if [ " $module " = " website" ]; then
28
+ branch=" production"
29
+ fi
30
+
31
+ # Set the default branch
32
+ git config -f .gitmodules --add " submodule.apps/$module .branch" ${branch}
33
+
34
+ # Update to the latest of branch in that submodule
35
+ cd apps/$module && git pull origin ${branch} && cd ../..
29
36
30
37
# We forcefully added the subdmoule which was in .gitignore, so unstage it.
31
38
git restore --staged apps/$module
You can’t perform that action at this time.
0 commit comments