From da31ae863b0088cbd964660ebebcde31f09c3f97 Mon Sep 17 00:00:00 2001 From: William Beuil Date: Wed, 14 Apr 2021 23:06:12 +0200 Subject: [PATCH] Add silent ENV var for CI purpose and bump version --- README.md | 1 + libexec/dctlenv-install | 14 +++++++++++++- libexec/dctlenv-version | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edb81c4..0f867c1 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,7 @@ You can configure how `dctlenv` operates with the following settings: | `DCTLENV_ARCH` | `amd64` | Architecture other than the default amd64 can be specified | | `DCTLENV_DEBUG` | `0` | Outputs debug information | | `DCTLENV_PGP` | `0` | Verify digital signatures | +| `DCTLENV_CURL` | `0` | Curl download progress bar, 0 will run a -# curl and 1 will run a -s curl | ## Contributors ✨ diff --git a/libexec/dctlenv-install b/libexec/dctlenv-install index 0ef61ac..49d909f 100755 --- a/libexec/dctlenv-install +++ b/libexec/dctlenv-install @@ -41,12 +41,24 @@ case "$(uname -s)" in ;; esac +case "${DCTLENV_CURL:-0}" in + 0) + curl="-#" + ;; + 1) + curl="-s" + ;; + *) + log_error 'You can only set DCTLENV_CURL to 0 or 1' + ;; +esac + driftctl_url="https://github.com/cloudskiff/driftctl/releases/download" echo "Installing driftctl v$version" echo "Downloading release tarball from $driftctl_url/v$version/driftctl_$os" -$(curlw -# -f -L -o "$dst_path/driftctl_$os" --create-dirs "$driftctl_url/v$version/driftctl_$os") || log_error 'Tarball download failed' +$(curlw "$curl" -f -L -o "$dst_path/driftctl_$os" --create-dirs "$driftctl_url/v$version/driftctl_$os") || log_error 'Tarball download failed' echo "Downloading SHA256 hashes file from $driftctl_url/v$version/driftctl_SHA256SUMS" $(curlw -s -f -L -o "$dst_path/driftctl_SHA256SUMS" "$driftctl_url/v$version/driftctl_SHA256SUMS") || log_debug 'SHA256 hashes download failed' diff --git a/libexec/dctlenv-version b/libexec/dctlenv-version index a65a823..f818c81 100755 --- a/libexec/dctlenv-version +++ b/libexec/dctlenv-version @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -uo pipefail -version="0.1.3" +version="0.1.4" git_revision="" if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q dctlenv; then