File: script.sh

package info (click to toggle)
lua-nvim 0.1.0-1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 180 kB
  • sloc: makefile: 70; ansic: 32
file content (40 lines) | stat: -rwxr-xr-x 904 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash

set -e
set -o pipefail
#set -o xtrace

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

get_nvim() {
  mkdir "$NVIM_INSTALL_PREFIX"
  curl -L https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz \
    | tar xzf - --strip-components=1 -C "$NVIM_INSTALL_PREFIX"
  "$NVIM_PROG" --version
}

get_or_build_deps() {
  rm -rf "${DEPS_INSTALL_PREFIX}"

  # Use cached dependencies if available (and not forced).
  if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
    echo "Using cached dependencies (last updated: $(stat -c '%y' "${CACHE_MARKER}"))."

    mkdir -p "$(dirname "${DEPS_INSTALL_PREFIX}")"
    ln -Ts "${HOME}/.cache/nvim-deps" "${DEPS_INSTALL_PREFIX}"
    return
  fi

  ${MAKE_CMD} deps
  get_nvim
}

run_tests() {
  make test
  echo "${SUCCESS_MARKER}"
  touch "${SUCCESS_MARKER}"
}

get_or_build_deps
run_tests