1 |
|
2 | #
|
3 | # Licensed under the Apache License, Version 2.0 (the "License");
|
4 | # you may not use this file except in compliance with the License.
|
5 | # You may obtain a copy of the License at
|
6 | #
|
7 | # http://www.apache.org/licenses/LICENSE-2.0
|
8 | #
|
9 | # Unless required by applicable law or agreed to in writing, software
|
10 | # distributed under the License is distributed on an "AS IS" BASIS,
|
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 | # See the License for the specific language governing permissions and
|
13 | # limitations under the License.
|
14 | #
|
15 |
|
16 | # find . -maxdepth 2 -name package.json | xargs jq -s 'reduce .[] as $item ({} ; . + {($item.name): {dependencies:$item.dependencies,devDependencies:$item.devDependencies }} )' | prettyoutput --indent 3
|
17 | # Exit on first error, print all commands.
|
18 | set -e
|
19 |
|
20 | # Grab the parent (root) directory.
|
21 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
22 |
|
23 | BIN=${DIR}/node_modules/.bin
|
24 |
|
25 | echo "Scanning all the node modules starting at "${DIR}
|
26 | #echo "Needs to have had npm install -g npm -g install licensecheck"
|
27 |
|
28 | rm -f "${DIR}/license-raw.txt"
|
29 | touch "${DIR}/license-raw.txt"
|
30 | rm -f "${DIR}/license-full.txt"
|
31 | touch "${DIR}/license-full.txt"
|
32 |
|
33 |
|
34 |
|
35 | ls -d "${DIR}"/packages/* | while read dirname
|
36 | do
|
37 | cd "${dirname}"
|
38 | ${BIN}/licensecheck --tsv >> "${DIR}/license-raw.txt"
|
39 | ${BIN}/licensecheck >> "${DIR}/license-full.txt"
|
40 | echo "-------------------------------------------" >> "${DIR}/license-full.txt"
|
41 |
|
42 | done
|
43 |
|
44 | exit |
\ | No newline at end of file |