|
|
@ -41,7 +41,8 @@ if [ $# -ge 2 ]; then
|
|
|
|
else
|
|
|
|
else
|
|
|
|
VERSION="$(npm view ${PACKAGE} version)"
|
|
|
|
VERSION="$(npm view ${PACKAGE} version)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# the package name might contain invalid characters, sanitize first
|
|
|
|
|
|
|
|
PACKAGE_SAFE=$(echo $PACKAGE | sed -e 's|/|-|g')
|
|
|
|
TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX)
|
|
|
|
TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX)
|
|
|
|
mkdir -p ${OUTPUT_DIR}
|
|
|
|
mkdir -p ${OUTPUT_DIR}
|
|
|
|
mkdir -p ${TMP_DIR}
|
|
|
|
mkdir -p ${TMP_DIR}
|
|
|
@ -59,10 +60,10 @@ else
|
|
|
|
mv node_modules/ node_modules_prod
|
|
|
|
mv node_modules/ node_modules_prod
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "LICENSES IN BUNDLE:"
|
|
|
|
echo "LICENSES IN BUNDLE:"
|
|
|
|
find . -name "package.json" -exec jq .license {} \; >> ${TMP_DIR}/${PACKAGE}-${VERSION}-bundled-licenses.txt
|
|
|
|
find . -name "package.json" -exec jq .license {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
|
|
|
find . -name "package.json" -exec jq '.licenses[] .type' {} \; >> ${TMP_DIR}/${PACKAGE}-${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}-${VERSION}-bundled-licenses.txt
|
|
|
|
sed -i "/^null$/d" ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
|
|
|
sort -u -o ${TMP_DIR}/${PACKAGE}-${VERSION}-bundled-licenses.txt ${TMP_DIR}/${PACKAGE}-${VERSION}-bundled-licenses.txt
|
|
|
|
sort -u -o ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
|
|
|
echo " Downloading dev dependencies"
|
|
|
|
echo " Downloading dev dependencies"
|
|
|
|
npm install --no-optional --only=dev
|
|
|
|
npm install --no-optional --only=dev
|
|
|
|
if [ $? -ge 1 ] ; then
|
|
|
|
if [ $? -ge 1 ] ; then
|
|
|
@ -72,12 +73,12 @@ else
|
|
|
|
mv node_modules/ node_modules_dev
|
|
|
|
mv node_modules/ node_modules_dev
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -d node_modules_prod ] ; then
|
|
|
|
if [ -d node_modules_prod ] ; then
|
|
|
|
tar cfz ../${PACKAGE}-${VERSION}-nm-prod.tgz node_modules_prod
|
|
|
|
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-prod.tgz node_modules_prod
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -d node_modules_dev ] ; then
|
|
|
|
if [ -d node_modules_dev ] ; then
|
|
|
|
tar cfz ../${PACKAGE}-${VERSION}-nm-dev.tgz node_modules_dev
|
|
|
|
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-dev.tgz node_modules_dev
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
cd ..
|
|
|
|
cp -v ${PACKAGE}-${VERSION}* $HOME/rpmbuild/SOURCES
|
|
|
|
cp -v ${PACKAGE_SAFE}-${VERSION}* $HOME/rpmbuild/SOURCES
|
|
|
|
popd > /dev/null
|
|
|
|
popd > /dev/null
|
|
|
|
rm -rf ${TMP_DIR}
|
|
|
|
rm -rf ${TMP_DIR}
|
|
|
|