From 49483d64891ecd6fddfb30f9fed5653829895159 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sat, 3 Oct 2020 17:14:53 +0800 Subject: [PATCH] Fix publish script --- publish.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/publish.sh b/publish.sh index c822683..4aec55f 100755 --- a/publish.sh +++ b/publish.sh @@ -1,11 +1,13 @@ +defaultBranch=master + for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do git checkout $branch rawRepository=$(cat package.json | jq -r .publishing.$branch.repository) repository=$(cat package.json | jq -r .publishing.$branch.repository) - currentRepository=$(cat package.json | jq -r .repository) + defaultRepository=$(cat package.json | jq -r .publishing.$defaultBranch.repository) - if [ $repository = $currentRepository ]; then + if [ $repository = $defaultRepository ]; then echo "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json echo "Publishing to primary repository: $repository" git push