forked from launchdarkly/react-client-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
link-dev.sh
executable file
·26 lines (21 loc) · 926 Bytes
/
link-dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
echo "===== Installing all dependencies..."
npm install
echo "===== Building react sdk"
npm run build
echo "===== Install prod dependencies"
rm -rf node_modules
npm install --production
echo "===== Linking to examples"
declare -a examples=(async-provider hoc typescript)
for example in "${examples[@]}"
do
echo "===== Linking to $example example"
mkdir -p examples/${example}/node_modules
rm -rf examples/${example}/node_modules/launchdarkly-react-client-sdk
mkdir -p examples/${example}/node_modules/launchdarkly-react-client-sdk/node_modules
mkdir -p examples/${example}/node_modules/launchdarkly-react-client-sdk/lib
cp package.json examples/${example}/node_modules/launchdarkly-react-client-sdk/package.json
cp -r node_modules/ examples/${example}/node_modules/launchdarkly-react-client-sdk/node_modules/
cp -r lib/ examples/${example}/node_modules/launchdarkly-react-client-sdk/lib/
done