summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/run.sh b/run.sh
index de8d4b0..6997490 100755
--- a/run.sh
+++ b/run.sh
@@ -115,12 +115,13 @@ case "$COMMAND" in
gem install bundler
# We need to install the license_finder gem into this Ruby version too.
gem install license_finder -v "$LICENSE_FINDER_VERSION"
+ gem install --no-document /opt/license-management/*.gem
fi
# Ignore test and development dependencies.
license_finder ignored_groups add development
license_finder ignored_groups add test
- bundle install --without "development test"
+ bundle install --without "development test" --jobs $(nproc)
skip_prepare=true
fi
@@ -189,17 +190,24 @@ case "$COMMAND" in
# Run License Finder.
echo "Running license_finder $@ in $PWD"
-
if [ "$skip_prepare" != true ]; then
prepare="--prepare"
fi
- license_finder report ${prepare} --format=html --save=gl-license-management-report.html
+ if [ "$FEATURE_RUBY_REPORT" = 'true' ]; then
+ echo "Preparing JSON report..."
+ license_management report ${prepare} --format=json --save=gl-license-management-report.json
+ else
+ echo "Preparing HTML report..."
+ license_finder report ${prepare} --format=html --save=gl-license-management-report.html
+ fi
# rvm removes trap in bash: https://github.com/rvm/rvm/issues/4416
declare -f restore_lockfile > /dev/null && restore_lockfile
popd > /dev/null
- # Extract data from the HTML report and put it into a JSON file
- node /html2json.js $APP_PATH/gl-license-management-report.html > $APP_PATH/gl-license-management-report.json
+ if [ -f "gl-license-management-report.html" ]; then
+ # Extract data from the HTML report and put it into a JSON file
+ node /html2json.js $APP_PATH/gl-license-management-report.html > $APP_PATH/gl-license-management-report.json
+ fi
;;
*)