diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-03-11 20:15:30 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-03-11 20:29:20 +0100 |
commit | c7f95fde1bb1d1a245ad015be10aa4d23fc48899 (patch) | |
tree | ac6c5370e06f3117164aeb07f942de9d362e55a8 | |
parent | 241c380da93835081e2c1a072d0a281245dd0af4 (diff) | |
download | rneovim-c7f95fde1bb1d1a245ad015be10aa4d23fc48899.tar.gz rneovim-c7f95fde1bb1d1a245ad015be10aa4d23fc48899.tar.bz2 rneovim-c7f95fde1bb1d1a245ad015be10aa4d23fc48899.zip |
ci/travis: Don't destroy cache during prepare
Use `cp -r` instead of `mv`.
Remove use of `dirname`, that was missed in 10cdf8c28621.
closes #5166
-rwxr-xr-x | ci/before_cache.sh | 3 | ||||
-rw-r--r-- | ci/common/build.sh | 21 |
2 files changed, 13 insertions, 11 deletions
diff --git a/ci/before_cache.sh b/ci/before_cache.sh index 3d7cc0ec5a..2340f4db74 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -4,6 +4,7 @@ set -e set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/suite.sh" # Don't cache pip's log and selfcheck. @@ -15,5 +16,5 @@ if ended_successfully; then rm -rf "${HOME}/.cache/nvim-deps" mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps" touch "${CACHE_MARKER}" - echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))." + echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))." fi diff --git a/ci/common/build.sh b/ci/common/build.sh index 772b696969..5b719940ab 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -1,3 +1,11 @@ +_stat() { + if test "${TRAVIS_OS_NAME}" = osx ; then + stat -f %Sm "${@}" + else + stat -c %y "${@}" + fi +} + top_make() { echo '================================================================================' # Travis has 1.5 virtual cores according to: @@ -19,19 +27,12 @@ build_deps() { fi rm -rf "${DEPS_BUILD_DIR}" + mkdir -p "${DEPS_BUILD_DIR}" # Use cached dependencies if $CACHE_MARKER exists. if test -f "${CACHE_MARKER}" && ! test "${CACHE_ENABLE}" = "false" ; then - local statcmd="stat -c '%y'" - if test "${TRAVIS_OS_NAME}" = osx ; then - statcmd="stat -f '%Sm'" - fi - echo "Using third-party dependencies from Travis cache (last update: $(${statcmd} "${CACHE_MARKER}"))." - - mkdir -p "$(dirname "${DEPS_BUILD_DIR}")" - mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" - else - mkdir -p "${DEPS_BUILD_DIR}" + echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))." + cp -r "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" fi # Even if we're using cached dependencies, run CMake and make to |