Compare commits
3 Commits
rawhide
...
bundler-ob
Author | SHA1 | Date | |
---|---|---|---|
|
7ccfee7db0 | ||
|
103e130f81 | ||
|
1dddec0614 |
@ -60,10 +60,21 @@ else
|
||||
mv node_modules/ node_modules_prod
|
||||
fi
|
||||
echo "LICENSES IN BUNDLE:"
|
||||
find . -name "package.json" -exec jq .license {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
||||
find . -name "package.json" -exec jq '.license | strings' {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
||||
find . -name "package.json" -exec jq '.license | objects | .type' {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt 2>/dev/null
|
||||
find . -name "package.json" -exec jq '.licenses[] .type' {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt 2>/dev/null
|
||||
sed -i "/^null$/d" ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
||||
sort -u -o ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
||||
|
||||
# Locate any dependencies without a provided license
|
||||
find . -type f -name package.json -execdir jq 'if .license==null and .licenses==null then .name else null end' '{}' '+' | grep -vE '^null$' | sort -u > ${TMP_DIR}/nolicense.txt
|
||||
|
||||
if [ -s ${TMP_DIR}/nolicense.txt ]; then
|
||||
echo -e "\e[5m\e[41mSome dependencies do not list a license. Manual verification required!\e[0m"
|
||||
cat ${TMP_DIR}/nolicense.txt
|
||||
echo -e "\e[5m\e[41m======================================================================\e[0m"
|
||||
fi
|
||||
|
||||
|
||||
echo " Downloading dev dependencies"
|
||||
npm install --no-optional --only=dev
|
||||
if [ $? -ge 1 ] ; then
|
||||
|
@ -42,7 +42,8 @@ nodejs-packaging-bundler bundles a node.js application node_module dependencies
|
||||
It gathers the application tarball.
|
||||
It generates a runtime (prod) tarball with runtime node_module dependencies
|
||||
It generates a testing (dev) tarball with node_module dependencies for testing
|
||||
It generates a bundled licence file that gets the licenses in the runtime dependency tarball
|
||||
It generates a bundled license file that gets the licenses in the runtime
|
||||
dependency tarball
|
||||
|
||||
%prep
|
||||
pushd %{_topdir}/BUILD
|
||||
|
Loading…
x
Reference in New Issue
Block a user