diff --git a/scripts/install-shellspec.sh b/scripts/install-shellspec.sh index 6dd1c98..7f3501e 100755 --- a/scripts/install-shellspec.sh +++ b/scripts/install-shellspec.sh @@ -10,16 +10,21 @@ SHELLSPEC_CACHE="$HOME/.cache/shellspec" install_shellspec() { + local version + version=$(x-gh-get-latest-version shellspec/shellspec) + msgr ok "Latest shellspec version: $version" + if [[ -d "$SHELLSPEC_CACHE" ]]; then - msgr ok "shellspec repo already cloned, pulling latest..." - git -C "$SHELLSPEC_CACHE" pull --quiet --depth=1 + msgr ok "shellspec repo already cloned, fetching $version..." + git -C "$SHELLSPEC_CACHE" fetch --depth=1 origin "refs/tags/$version" + git -C "$SHELLSPEC_CACHE" checkout "$version" else - git clone --depth 1 "$SHELLSPEC_REPO" "$SHELLSPEC_CACHE" + git clone --branch "$version" --depth=1 "$SHELLSPEC_REPO" "$SHELLSPEC_CACHE" fi msgr run "Running make install..." make -C "$SHELLSPEC_CACHE" install PREFIX="$HOME/.local" - msgr run_done "shellspec installed to $HOME/.local/bin/shellspec" + msgr run_done "shellspec $version installed to $HOME/.local/bin/shellspec" return 0 }