Browse Source

Fix publish script

master
TheoryOfNekomata 4 years ago
parent
commit
49483d6489
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      publish.sh

+ 4
- 2
publish.sh View File

@@ -1,11 +1,13 @@
defaultBranch=master

for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do
git checkout $branch git checkout $branch


rawRepository=$(cat package.json | jq -r .publishing.$branch.repository) rawRepository=$(cat package.json | jq -r .publishing.$branch.repository)
repository=$(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 "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json
echo "Publishing to primary repository: $repository" echo "Publishing to primary repository: $repository"
git push git push


Loading…
Cancel
Save