Skip to content

Commit

Permalink
minor refactor: assign $1 as $IS_MONOREPO
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Jul 1, 2024
1 parent df63592 commit a51b59c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ else
fi
fi

IS_MONOREPO="$1"

# "dry-run" for polyrepo
if [[ -z "$YARN_NPM_AUTH_TOKEN" && -z "$1" ]]; then
if [[ -z "$YARN_NPM_AUTH_TOKEN" && -z "$IS_MONOREPO" ]]; then
echo "Notice: 'npm-token' not set. Running '$PACK_CMD'."
$INSTALL_CMD
$PACK_CMD
Expand All @@ -46,7 +48,7 @@ if [[ "$CURRENT_PACKAGE_VERSION" = "0.0.0" ]]; then
fi

# check param, if it's set (monorepo) we check if it's published before proceeding
if [[ -n "$1" ]]; then
if [[ -n "$IS_MONOREPO" ]]; then
# check if module is published
PACKAGE_NAME=$(jq --raw-output .name package.json)
LATEST_PACKAGE_VERSION=$(npm view "$PACKAGE_NAME" dist-tags --workspaces false --json | jq --raw-output --arg tag "$PUBLISH_NPM_TAG" '.[$tag]' || echo "")
Expand Down

0 comments on commit a51b59c

Please sign in to comment.