Ensure git clean state after running license_finder
Our script for validating licenses does not restore a clean git state because the whole script "scripts/license-check.sh" is marked as "set -e" which means if any command fails with a non-zero exit code the script terminates its execution. The failing scenario is: 1. We start "license-check.sh" script which modifies "Gemfile.lock" due to a workaround described inside of the script. 2. Then we run "license_finder" gem. 3. If it exits with a non-zero status code then the next command "git checkout -q" will never execute. The simplest solution to resolve that failing scenario is to capture the exit code of "license_finder" gem, store it, restore the git clean state and exit with this exit code.
想要评论请 注册 或 登录