Skip to content
Myr

[Fix] install script: check the proper version; fetch tags also

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sladyn Nunes · committed by Jordan Harband · parent f534fde · Browse files · 1 file+13 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
  • Co-authored-by: Jordan Harband <ljharb@gmail.com>

Diff stats

1 file+13 added−5 removed

  • tests:+13 added−5 removed

1 file+13 added−5 removed

modified:test/install_script/install_nvm_from_git+13 added-5 removed
53 unmodified lines
54 local message="$3"55 local ref="$4"56 local changeset="$5"57 local avoid_ref="$6"5859 if [ -n "$ref" ]; then59 echo "$current_ref" | grep -q "$ref" || die "install_nvm_from_git $message did not clone with ref $ref"60 echo "$current_ref" | grep -q "$ref" || die "install_nvm_from_git ${message} did not clone with ref ${ref}"61 fi61 if [ -n "$avoid_ref" ]; then62 echo "$current_ref" | grep -q "$avoid_ref" && die "install_nvm_from_git $message did clone with unwanted ref $avoid_ref"6263 local head_ref="$(git for-each-ref --points-at HEAD --format='%(refname:short)' 'refs/tags/')"64 if [ -n "${avoid_ref}" ] && [ "${head_ref}" != "${avoid_ref}"]; then65 echo "${current_ref}" | grep -q "$avoid_ref" && die "install_nvm_from_git ${message} did clone with unwanted ref ${avoid_ref}"66 fi6768 if [ -n "$changeset" ]; then65 echo "$current_changeset" | grep -q "$changeset" || die "install_nvm_from_git $message did not clone with changeset $changeset"69 echo "${current_changeset}" | grep -q "${changeset}" || die "install_nvm_from_git ${message} did not clone with changeset ${changeset}"70 fi71}7273# args:
2 unmodified lines
76# - 3: ref to check ("" if none)77# - 4: changeset to check ("" if none)78# - 5: ref to avoid ("" if none)79test_install() {80 if [ -n "${1-}" ]; then76 NVM_INSTALL_VERSION="$1"81 export NVM_INSTALL_VERSION="$1"82 else83 unset NVM_INSTALL_VERSION84 fi85 local message="$2"86 local ref="$3"87 local changeset="$4"88 local avoid_ref="$5"
41 unmodified lines