diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5fdbac035..56f31c210 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,6 +14,8 @@ brews: name: bearer folder: Formula install: bin.install "bearer" + dependencies: + - name: git tap: owner: Bearer name: homebrew-tap diff --git a/contrib/install.sh b/contrib/install.sh index b2bc4d30d..dd1b4c561 100755 --- a/contrib/install.sh +++ b/contrib/install.sh @@ -244,6 +244,16 @@ http_copy() { echo "$body" } +check_dependencies() { + log_info "Checking dependencies..." + if git --version &> /dev/null; then + log_debug "Git is installed. Version: $(git --version)" + else + log_crit "Git is not installed on this system." + return 1 + fi +} + github_release() { owner_repo=$1 version=$2 @@ -310,6 +320,7 @@ log_prefix() { echo "$PREFIX" } + PLATFORM="${OS}/${ARCH}" GITHUB_DOWNLOAD=https://github.com/${OWNER}/${REPO}/releases/download @@ -318,6 +329,8 @@ uname_arch_check "$ARCH" parse_args "$@" +check_dependencies + get_binaries tag_to_version diff --git a/internal/git/git.go b/internal/git/git.go index 6cd424cb3..d12845bbc 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -91,7 +91,6 @@ func captureCommand(ctx context.Context, workingDir string, args []string, captu } if err := command.Start(); err != nil { - command.Cancel() //nolint:errcheck return err }