Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: non-scoped package handling #2367

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions internal/builders/nodejs/generate-layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ set -euo pipefail

# Get the raw package name and scope from the output of `npm pack --json`
# This name is of the form '<scope>/<package name>'
raw_package_scope=$(echo "${PACKAGE_NAME:-}" | cut -d'/' -f1)
raw_package_name=$(echo "${PACKAGE_NAME:-}" | cut -d'/' -f2)
# NOTE: `cut -s` will suppress output for all fields if the delimiter is
# not present.
raw_package_scope=$(echo "${PACKAGE_NAME:-}" | cut -s -d'/' -f1)
raw_package_name=$(echo "${PACKAGE_NAME:-}" | cut -s -d'/' -f2)
if [ "${raw_package_name}" == "" ]; then
raw_package_name="${raw_package_scope}"
# This is a non-scoped package.
raw_package_name="${PACKAGE_NAME:-}"
raw_package_scope=""
fi
# package scope (namespace) is URL(percent) encoded.
Expand Down
Loading