Skip to content

Commit 96889a3

Browse files
committed
package.json auto detect for boot repo
1 parent d175f5a commit 96889a3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

boot

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fi
99

1010
if [ $BOOT_GITREPO ]; then
1111

12-
# BOOT_GITREPO path find
12+
## BOOT_GITREPO path find
1313
cd /
1414
BOOT_GITREPO_PATH="${BOOT_GITREPO##*/}"
1515
BOOT_GITREPO_PATH="/${BOOT_GITREPO_PATH%%.git}"
@@ -18,11 +18,20 @@ if [ $BOOT_GITREPO ]; then
1818
grep -qF -- "export BOOT_GITREPO=$BOOT_GITREPO" "/etc/bashrc" || echo "BOOT_GITREPO=$BOOT_GITREPO" >> "/etc/bashrc"
1919
grep -qF -- "export BOOT_GITREPO_PATH=$BOOT_GITREPO_PATH" "/etc/bashrc" || echo "BOOT_GITREPO_PATH=$BOOT_GITREPO_PATH" >> "/etc/bashrc"
2020

21-
# remove old repo and links
21+
## remove old repo and links
2222
rm -rf $BOOT_GITREPO_PATH
2323

2424
## setup boot repo
2525
git clone $BOOT_GITREPO
26+
27+
## npm init if boot repo has npm scripts
28+
if test -f "$BOOT_GITREPO_PATH/package.json"; then
29+
cd $BOOT_GITREPO_PATH
30+
npm i --legacy-peer-deps
31+
cd /
32+
fi
33+
34+
## add boot repo to path
2635
export PATH=${BOOT_GITREPO_PATH}:${PATH}
2736
fi
2837

0 commit comments

Comments
 (0)