From 6647167d02c30e8c9b924fa4a66320e74933fad7 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 15 Mar 2018 01:14:18 +0000 Subject: [PATCH] chore: Allow namespaced requires to be sanity-checked Fixes #2120 Change-type: patch --- scripts/ci/ensure-all-node-requirements-available.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ci/ensure-all-node-requirements-available.sh b/scripts/ci/ensure-all-node-requirements-available.sh index 73ab49c4..759151ef 100755 --- a/scripts/ci/ensure-all-node-requirements-available.sh +++ b/scripts/ci/ensure-all-node-requirements-available.sh @@ -36,7 +36,7 @@ NPM_DEV_MODULES=($(jq -r '.devDependencies | keys | .[]' "$PACKAGE_JSON")) DEV_FILES_REGEX=^\(tests\|scripts\)/ # need to do a non-greedy match, which is why we're not using (.*) -REQUIRE_REGEX=require\\\(\'\([-_/\.a-z0-9]+\)\'\\\) +REQUIRE_REGEX=require\\\(\'\(@?[-_/\.a-z0-9]+\)\'\\\) JS_OR_JSON_REGEX=\.js\(on\)?$ HTML_REGEX=\.html$ @@ -68,7 +68,9 @@ git ls-tree -r HEAD | while IFS='' read line; do requirement_found=1 fi else - required=${required%%/*} + if [[ ! "$required" =~ ^@ ]]; then + required=${required%%/*} + fi fi fi if [[ $is_local -eq 0 ]]; then