Skip to content

Commit 810b5cb

Browse files
committed
fix(scripts): use bash array for publish args and idiomatic checks
1 parent f2870bd commit 810b5cb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/publish.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ cat CHANGELOG.md >> "${RELEASE_NOTES_FILE}"
105105
echo "Made the release notes."
106106

107107
echo "Publishing to npm..."
108-
PUBLISH_ARGS=""
109-
if [[ $DRY_RUN != "" ]]; then
108+
PUBLISH_ARGS=()
109+
if [[ -n "$DRY_RUN" ]]; then
110110
echo "DRY RUN: running publish with --dry-run"
111-
PUBLISH_ARGS="--dry-run"
111+
PUBLISH_ARGS+=(--dry-run)
112112
fi
113113

114-
if [[ $PRE_RELEASE != "" ]]; then
115-
PUBLISH_ARGS="$PUBLISH_ARGS --tag next"
114+
if [[ -n "$PRE_RELEASE" ]]; then
115+
PUBLISH_ARGS+=(--tag next)
116116
fi
117117

118-
npm publish $PUBLISH_ARGS
118+
npm publish "${PUBLISH_ARGS[@]}"
119119
echo "Published to npm."
120120

121121
if [[ $PRE_RELEASE != "" ]]; then

0 commit comments

Comments
 (0)