From 114f6043614d0a74a62aabe3829bd80a753b0dd0 Mon Sep 17 00:00:00 2001 From: Janos Bonic <86970079+janosdebugs@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:29:09 +0100 Subject: [PATCH] Adding GPG check Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com> --- src/install-opentofu.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/install-opentofu.sh b/src/install-opentofu.sh index a702fdc..c91bef6 100755 --- a/src/install-opentofu.sh +++ b/src/install-opentofu.sh @@ -283,6 +283,10 @@ download_gpg() { log_error "Bug: no destination passed to download_gpg." return $TOFU_INSTALL_EXIT_CODE_INVALID_ARGUMENT fi + if ! command_exists "gpg"; then + log_error "Missing gpg binary." + return $TOFU_INSTALL_EXIT_CODE_INSTALL_METHOD_NOT_SUPPORTED + fi log_debug "Downloading GPG key from ${1} to ${2}..." if ! download_tool_exists; then return $TOFU_INSTALL_EXIT_CODE_DOWNLOAD_TOOL_MISSING