-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract license list tool from license checker tool (#151)
- Loading branch information
Showing
3 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# check Node licenses | ||
if [ -f package.json ]; then | ||
{ echo "Checking Node licenses ..."; } 2>/dev/null | ||
npm exec -- license-checker --csv --production --excludePrivatePackages --customPath .bin/license-template-node.json | .bin/license-engine.sh | ||
{ echo; } 2>/dev/null | ||
fi | ||
|
||
# check Go licenses | ||
if [ -f go.mod ]; then | ||
{ echo "Checking Go licenses ..."; } 2>/dev/null | ||
module_name=$(grep "^module" go.mod | awk '{print $2}') | ||
if [ -z "$module_name" ]; then | ||
echo "Cannot determine the Go module name" | ||
exit 1 | ||
fi | ||
.bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null | .bin/license-engine.sh | ||
{ echo; } 2>/dev/null | ||
fi | ||
{ echo "Checking licenses ..."; } 2>/dev/null | ||
.bin/list-licenses | .bin/license-engine.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# list Node licenses | ||
if [ -f package.json ]; then | ||
npm exec --yes license-checker -- --csv --production --excludePrivatePackages --customPath .bin/license-template-node.json | ||
{ echo; } 2>/dev/null | ||
fi | ||
|
||
# list Go licenses | ||
if [ -f go.mod ]; then | ||
module_name=$(grep "^module" go.mod | awk '{print $2}') | ||
if [ -z "$module_name" ]; then | ||
echo "Cannot determine the Go module name" >&2 | ||
exit 1 | ||
fi | ||
.bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null | ||
{ echo; } 2>/dev/null | ||
fi |