File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,6 @@ set -eo pipefail
14
14
# # Install js-client-sdk-common changes into a test app
15
15
# # ./scripts/local-install.sh . ../js-client-sdk && ./scripts/local-install.sh ../js-client-sdk ../test-apps/my-react-app
16
16
17
- if ! command -v jq & > /dev/null; then
18
- echo " jq must be installed before using this script"
19
- exit 1
20
- fi
21
-
22
17
if [[ " $1 " = " " || " $2 " = " " ]]; then
23
18
echo ' usage: local-install.sh <package-to-install-dir> <consuming-app-dir>'
24
19
exit 1
@@ -53,14 +48,16 @@ COMPRESSED_PACKAGE="$(tail -1 /tmp/pack.out)"
53
48
tar -xzf " ${COMPRESSED_PACKAGE} "
54
49
rm " ${COMPRESSED_PACKAGE} "
55
50
mv package " ${PACKAGE_DIR} "
56
- PACKAGE_NAME=$( cat ./package.json | jq -r ' .name' )
51
+ PACKAGE_NAME=$( node -p " require(' ./package.json') .name" )
57
52
popd > /dev/null
58
53
59
54
# ## Install local package to target package
60
55
pushd " $2 " > /dev/null
61
56
TARGET_DIR=" $( pwd) "
62
57
rm -rf node_modules/.cache
63
- yarn remove " ${PACKAGE_NAME} "
58
+ if [ " $( grep -c ' "' " $PACKAGE_NAME " ' "' ./package.json) " -gt 0 ]; then
59
+ yarn remove " ${PACKAGE_NAME} "
60
+ fi
64
61
yarn add " ${PACKAGE_DIR} " --exact
65
62
popd > /dev/null
66
63
You can’t perform that action at this time.
0 commit comments