Skip to content

Commit 7b02475

Browse files
committed
fetch-develop-deps: avoid breaking js-sdk
do `npm i` in react-sdk *before* symlinking js-sdk, to avoid moving a load of deps from js-sdk to react-sdk and hence breaking the build.
1 parent 9c3c1b7 commit 7b02475

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

‎scripts/fetch-develop.deps.sh‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,47 @@ function dodep() {
4949
[ "$curbranch" != 'develop' ] && clone $org $repo develop
5050
} || return $?
5151

52-
(
53-
cd $repo
54-
echo "$repo set to branch "`git rev-parse --abbrev-ref HEAD`
55-
)
52+
echo "$repo set to branch "`git -C "$repo" rev-parse --abbrev-ref HEAD`
5653

5754
mkdir -p node_modules
5855
rm -r "node_modules/$repo" 2>/dev/null || true
5956
ln -sv "../$repo" node_modules/
57+
58+
(
59+
cd $repo
60+
npm install
61+
)
6062
}
6163

64+
##############################
65+
6266
echo -en 'travis_fold:start:matrix-js-sdk\r'
6367
echo 'Setting up matrix-js-sdk'
6468

6569
dodep matrix-org matrix-js-sdk
66-
(
67-
cd node_modules/matrix-js-sdk
68-
npm install
69-
)
7070

7171
echo -en 'travis_fold:end:matrix-js-sdk\r'
7272

73+
##############################
74+
7375
echo -en 'travis_fold:start:matrix-react-sdk\r'
7476
echo 'Setting up matrix-react-sdk'
7577

7678
dodep matrix-org matrix-react-sdk
7779

78-
mkdir -p node_modules/matrix-react-sdk/node_modules
80+
# replace the version of js-sdk that got pulled into react-sdk with a symlink
81+
# to our version. Make sure to do this *after* doing 'npm i' in react-sdk,
82+
# otherwise npm helpfully moves another-json from matrix-js-sdk/node_modules
83+
# into matrix-react-sdk/node_modules.
84+
#
85+
# (note this matches the instructions in the README.)
86+
rm -r node_modules/matrix-react-sdk/node_modules/matrix-js-sdk
7987
ln -s ../../matrix-js-sdk node_modules/matrix-react-sdk/node_modules/
8088

81-
(
82-
cd node_modules/matrix-react-sdk
83-
npm install
84-
)
85-
8689
echo -en 'travis_fold:end:matrix-react-sdk\r'
8790

91+
##############################
92+
8893
# Link the reskindex binary in place: if we used npm link,
8994
# npm would do this for us, but we don't because we'd have
9095
# to define the npm prefix somewhere so it could put the

0 commit comments

Comments
 (0)