From 6d2749a46126d0b5f994217b792bd4c92f1090b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Mon, 27 Nov 2023 10:34:48 +0100 Subject: [PATCH 1/3] fix(git): avoid error message to be swallowed --- internal/git/git.go | 1 - 1 file changed, 1 deletion(-) 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 } From bcae91aea57f78376d3535e220431969db66b685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Mon, 27 Nov 2023 12:01:01 +0100 Subject: [PATCH 2/3] feat(git): add git dependency to brew --- .goreleaser.yaml | 2 ++ 1 file changed, 2 insertions(+) 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 From 98393b360bd1ae7e6bc460e31464449453583966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Fabianski?= Date: Mon, 27 Nov 2023 14:08:59 +0100 Subject: [PATCH 3/3] feat: add dependency check on install script --- contrib/install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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