Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/license-check.sh')
-rwxr-xr-xscripts/license-check.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/license-check.sh b/scripts/license-check.sh
index 2a210754a0d..58dc799d0a2 100755
--- a/scripts/license-check.sh
+++ b/scripts/license-check.sh
@@ -18,6 +18,10 @@ set -euo pipefail
PROJECT_PATH=${1:-`pwd`}
+function restore_git_state() {
+ git checkout -q Gemfile Gemfile.lock
+}
+
echo "Using project path ${PROJECT_PATH}"
GEMFILE_DIFF=`git diff Gemfile Gemfile.lock`
@@ -27,7 +31,7 @@ if [ ! -z "$GEMFILE_DIFF" ]; then
exit 1
fi
+trap restore_git_state EXIT
+
BUNDLE_DEPLOYMENT=false BUNDLE_FROZEN=false bundle lock --add-platform `ruby -e "puts RUBY_PLATFORM"`
bundle exec license_finder --decisions-file config/dependency_decisions.yml --project-path ${PROJECT_PATH}
-
-git checkout -q Gemfile Gemfile.lock