Merge pull request #2123 from lurch/etcher-2120

chore: Allow namespaced requires to be sanity-checked
This commit is contained in:
Jonas Hermsmeier 2018-03-21 20:27:26 +01:00 committed by GitHub
commit 624b95921a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ NPM_DEV_MODULES=($(jq -r '.devDependencies | keys | .[]' "$PACKAGE_JSON"))
DEV_FILES_REGEX=^\(tests\|scripts\)/ DEV_FILES_REGEX=^\(tests\|scripts\)/
# need to do a non-greedy match, which is why we're not using (.*) # 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\)?$ JS_OR_JSON_REGEX=\.js\(on\)?$
HTML_REGEX=\.html$ HTML_REGEX=\.html$
@ -68,9 +68,11 @@ git ls-tree -r HEAD | while IFS='' read line; do
requirement_found=1 requirement_found=1
fi fi
else else
if [[ ! "$required" =~ ^@ ]]; then
required=${required%%/*} required=${required%%/*}
fi fi
fi fi
fi
if [[ $is_local -eq 0 ]]; then if [[ $is_local -eq 0 ]]; then
# electron is implictly available # electron is implictly available
if [[ "$required" == "electron" ]]; then if [[ "$required" == "electron" ]]; then