From fac8906102be707b1a0b3bdec8f5e6788e5fe4d3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 17 May 2017 16:11:34 +0100 Subject: [PATCH] Add script to fetch correct dep branches Fetch branches of js-sdk and react-sdk that match the current branch name, if they exist. This will mostly be used in the automated tests. --- scripts/fetch-develop.deps.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/fetch-develop.deps.sh diff --git a/scripts/fetch-develop.deps.sh b/scripts/fetch-develop.deps.sh new file mode 100755 index 00000000..c5756a86 --- /dev/null +++ b/scripts/fetch-develop.deps.sh @@ -0,0 +1,25 @@ +#!/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` + +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 + echo "$repo set to branch "`git rev-parse --abbrev-ref HEAD` + popd +} + +dodep matrix-org matrix-js-sdk +dodep matrix-org matrix-react-sdk