2017-05-17 23:11:34 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Fetches the js-sdk and matrix-react-sdk dependencies for development
|
|
|
|
# or testing purposes
|
|
|
|
# If there exists a branch of that dependency with the same name as
|
|
|
|
# the branch the current checkout is on, use that branch. Otherwise,
|
|
|
|
# use develop.
|
|
|
|
|
|
|
|
curbranch=`git rev-parse --abbrev-ref HEAD`
|
|
|
|
|
2017-05-17 23:19:19 +08:00
|
|
|
mkdir -p node_modules
|
2017-05-17 23:11:34 +08:00
|
|
|
cd node_modules
|
|
|
|
|
|
|
|
function dodep() {
|
|
|
|
org=$1
|
|
|
|
repo=$2
|
|
|
|
rm -rf $repo || true
|
|
|
|
git clone https://github.com/$org/$repo.git $repo
|
|
|
|
pushd $repo
|
|
|
|
git checkout $curbranch || git checkout develop
|
2017-05-17 23:17:08 +08:00
|
|
|
npm install
|
2017-05-17 23:11:34 +08:00
|
|
|
echo "$repo set to branch "`git rev-parse --abbrev-ref HEAD`
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
dodep matrix-org matrix-js-sdk
|
|
|
|
dodep matrix-org matrix-react-sdk
|