From d31a4984571c73d48c66959e39201c95539cb998 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 4 Jul 2023 17:14:31 +0100 Subject: [PATCH] Tweak branch matching to allow not applying outside of PRs for matrix-analytics-events (#25712) --- scripts/layered.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/layered.sh b/scripts/layered.sh index 62b8b5a0b3..c9c78cfe1d 100755 --- a/scripts/layered.sh +++ b/scripts/layered.sh @@ -21,27 +21,30 @@ export PR_ORG=vector-im export PR_REPO=element-web # Set up the js-sdk first -node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-js-sdk +node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-js-sdk develop pushd matrix-js-sdk yarn link yarn install --frozen-lockfile popd -# Also set up matrix-analytics-events so we get the latest from -# the main branch or a branch with matching name -node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-analytics-events main -pushd matrix-analytics-events -yarn link -yarn install --frozen-lockfile -yarn build:ts -popd +# Also set up matrix-analytics-events for branch with matching name +node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-analytics-events +# We don't pass a default branch so cloning may fail when we are not in a PR +# This is expected as this project does not share a release cycle but we still branch match it +if [ -d matrix-analytics-events ]; then + pushd matrix-analytics-events + yarn link + yarn install --frozen-lockfile + yarn build:ts + popd +fi # Now set up the react-sdk -node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-react-sdk +node_modules/matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-react-sdk develop pushd matrix-react-sdk yarn link yarn link matrix-js-sdk -yarn link @matrix-org/analytics-events +[ -d matrix-analytics-events ] && yarn link @matrix-org/analytics-events yarn install --frozen-lockfile popd