diff --git a/licenses/list-licenses b/licenses/list-licenses index 2f27653..3157817 100755 --- a/licenses/list-licenses +++ b/licenses/list-licenses @@ -3,8 +3,12 @@ set -e # list Node licenses if [ -f package.json ]; then - npm exec --yes license-checker -- --production --csv --excludePrivatePackages --customPath .bin/license-template-node.json - { echo; } 2>/dev/null + if grep -q '"dependencies":\s*\{[^}]*"[^"]+":' package.json; then + npm exec --yes license-checker -- --production --csv --excludePrivatePackages --customPath .bin/license-template-node.json + { echo; } 2>/dev/null + else + echo "No dependencies found in package.json" >&2 + fi fi # list Go licenses