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.
This commit is contained in:
Richard van der Hoff 2017-08-08 09:43:40 +01:00
parent 9c3c1b7608
commit 7b024751d1

View File

@ -49,42 +49,47 @@ function dodep() {
[ "$curbranch" != 'develop' ] && clone $org $repo develop
} || return $?
(
cd $repo
echo "$repo set to branch "`git rev-parse --abbrev-ref HEAD`
)
echo "$repo set to branch "`git -C "$repo" rev-parse --abbrev-ref HEAD`
mkdir -p node_modules
rm -r "node_modules/$repo" 2>/dev/null || true
ln -sv "../$repo" node_modules/
(
cd $repo
npm install
)
}
##############################
echo -en 'travis_fold:start:matrix-js-sdk\r'
echo 'Setting up matrix-js-sdk'
dodep matrix-org matrix-js-sdk
(
cd node_modules/matrix-js-sdk
npm install
)
echo -en 'travis_fold:end:matrix-js-sdk\r'
##############################
echo -en 'travis_fold:start:matrix-react-sdk\r'
echo 'Setting up matrix-react-sdk'
dodep matrix-org matrix-react-sdk
mkdir -p node_modules/matrix-react-sdk/node_modules
# replace the version of js-sdk that got pulled into react-sdk with a symlink
# to our version. Make sure to do this *after* doing 'npm i' in react-sdk,
# otherwise npm helpfully moves another-json from matrix-js-sdk/node_modules
# into matrix-react-sdk/node_modules.
#
# (note this matches the instructions in the README.)
rm -r node_modules/matrix-react-sdk/node_modules/matrix-js-sdk
ln -s ../../matrix-js-sdk node_modules/matrix-react-sdk/node_modules/
(
cd node_modules/matrix-react-sdk
npm install
)
echo -en 'travis_fold:end:matrix-react-sdk\r'
##############################
# Link the reskindex binary in place: if we used npm link,
# npm would do this for us, but we don't because we'd have
# to define the npm prefix somewhere so it could put the