Skip to content

Commit

Permalink
feat: only list for existing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 30, 2024
1 parent 241a67f commit fd49a10
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions licenses/list-licenses
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd49a10

Please sign in to comment.