Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
add license helper script
Browse files Browse the repository at this point in the history
  • Loading branch information
Orie Steele committed Jul 8, 2019
1 parent 5aac63b commit 4e9177c
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,6 @@ node_modules
.firebase
elem-cache
attic
*.log
*.log

licenses
85 changes: 85 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -12,13 +12,15 @@
"coverage": "lerna run coverage --stream",
"test:contracts": "lerna run test:contracts --stream",
"pre:push": "npm run lint",
"codecov": "codecov"
"codecov": "codecov",
"license:report": "./scripts/get-license-report.sh"
},
"devDependencies": {
"codecov": "^3.1.0",
"firebase-tools": "^6.1.1",
"husky": "^1.3.1",
"lerna": "^3.15.0"
"lerna": "^3.15.0",
"license-checker": "^25.0.1"
},
"husky": {
"hooks": {
Expand Down
18 changes: 18 additions & 0 deletions scripts/get-license-report.sh
@@ -0,0 +1,18 @@

# Generate CSVs of all Open Source Licenses

rm -rf ./licenses
mkdir -p licenses

npx license-checker --csv >> ./licenses/element-mono.csv

LERNA_PACKAGE_DIR="./packages/*"

for d in $LERNA_PACKAGE_DIR; do
cd $d
PACKAGE_NAME=$(cat package.json | jq ".name" | tr -d '"' | sed 's/@transmute//g')
npx license-checker --csv > ../../licenses/$PACKAGE_NAME.csv
cd ../..
done

echo "# Element Licenses Report \nDate: $(date)" > ./licenses/README.md

0 comments on commit 4e9177c

Please sign in to comment.