fix.sh in checkoff-0.9.0 vs fix.sh in checkoff-0.10.0

- old
+ new

@@ -100,20 +100,20 @@ # Not sure why this is needed a second time, but it seems to be? # # https://app.circleci.com/pipelines/github/apiology/source_finder/21/workflows/88db659f-a4f4-4751-abc0-46f5929d8e58/jobs/107 set_rbenv_env_variables bundle --version >/dev/null 2>&1 || gem install bundler - bundle install + make bundle_install # https://bundler.io/v2.0/bundle_lock.html#SUPPORTING-OTHER-PLATFORMS # # "If you want your bundle to support platforms other than the one # you're running locally, you can run bundle lock --add-platform # PLATFORM to add PLATFORM to the lockfile, force bundler to # re-resolve and consider the new platform when picking gems, all # without needing to have a machine that matches PLATFORM handy to # install those platform-specific gems on.' - bundle lock --add-platform x86_64-darwin-20 x86_64-linux + grep x86_64-darwin-20 Gemfile.lock >/dev/null 2>&1 || bundle lock --add-platform x86_64-darwin-20 x86_64-linux } set_ruby_local_version() { latest_ruby_version="$(cut -d' ' -f1 <<< "${ruby_versions}")" echo "${latest_ruby_version}" > .ruby-version @@ -237,30 +237,53 @@ } ensure_pip() { # Make sure we have a pip with the 20.3 resolver, and after the # initial bugfix release - pip install 'pip>=20.3.1' + major_pip_version=$(pip --version | cut -d' ' -f2 | cut -d '.' -f 1) + if [[ major_pip_version -lt 21 ]] + then + pip install 'pip>=20.3.1' + fi } ensure_python_requirements() { - pip install -r requirements_dev.txt + make pip_install } ensure_shellcheck() { if ! type shellcheck >/dev/null 2>&1 then install_package shellcheck fi } +ensure_overcommit() { + # don't run if we're in the middle of a cookiecutter child project + # test, or otherwise don't have a Git repo to install hooks into... + if [ -d .git ] + then + bundle exec overcommit --install + else + >&2 echo 'Not in a git repo; not installing git hooks' + fi +} + +ensure_rugged_packages_installed() { + install_package icu4c libicu-dev # needed by rugged, needed by undercover + install_package pkg-config # needed by rugged, needed by undercover + install_package cmake # needed by rugged, needed by undercover +} + ensure_rbenv ensure_ruby_versions set_ruby_local_version +ensure_rugged_packages_installed + ensure_bundle ensure_pyenv ensure_python_versions @@ -270,5 +293,7 @@ ensure_pip ensure_python_requirements ensure_shellcheck + +ensure_overcommit