Skip to content

Commit

Permalink
Fix name slash check for scoped packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn authored and mattcollier committed May 22, 2020
1 parent 0494f33 commit ea46309
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pubnpm
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,12 @@ if [ -z "$VERSION_TYPE" ] || ! [[ "$VERSION_TYPE" =~ ^(major|minor|patch)$ ]]; t
echo "$MSG_ERROR: A release type must be specified: [major | minor | patch]"
exit 1
fi

# FIXME: this does not work with scoped packages like @digitalbazaar/foo
#
# if [[ "$PACKAGE_NAME" == *\/* ]] || [[ "$PACKAGE_NAME" == *\\* ]]; then
# echo "$MSG_ERROR: Slashes detected in package name. Aborting."
# exit 1
# fi
if [[ "$PACKAGE_NAME" != @*\/* ]]; then
if [[ "$PACKAGE_NAME" == *\/* ]] || [[ "$PACKAGE_NAME" == *\\* ]]; then
echo "$MSG_ERROR: Slashes detected in package name. Aborting."
exit 1
fi
fi

if [ "$VERBOSE" = true ]; then
echo DRY_RUN=$DRY_RUN
Expand Down

0 comments on commit ea46309

Please sign in to comment.