From 88f6b3f8eedba9ea52f905f2f68d7877ea5dd319 Mon Sep 17 00:00:00 2001 From: Igor Zibarev Date: Tue, 3 Oct 2017 18:52:54 +0300 Subject: [PATCH] Download with curl if possible --- plugin.yaml | 4 ++-- sh/install.sh | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/plugin.yaml b/plugin.yaml index 4ebf39e7..a36dcc1a 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "s3" -version: "0.2.0" +version: "0.2.1" usage: "The plugin allows to use s3 protocol to upload, fetch charts and to work with repositories." description: |- Provides AWS S3 protocol support. @@ -11,4 +11,4 @@ downloaders: - "s3" hooks: install: "cd $HELM_PLUGIN_DIR; make install" - update: "cd $HELM_PLUGIN_DIR; make install" \ No newline at end of file + update: "cd $HELM_PLUGIN_DIR; make install" diff --git a/sh/install.sh b/sh/install.sh index 2d1600cd..43e499f1 100755 --- a/sh/install.sh +++ b/sh/install.sh @@ -25,6 +25,11 @@ fi mkdir -p "bin" mkdir -p "releases/v${version}" -wget -q "${url}" -O "releases/v${version}.tar.gz" +# Download with curl if possible. +if [ -x "$(which curl 2>/dev/null)" ]; then + curl -sSL "${url}" -o "releases/v${version}.tar.gz" +else + wget -q "${url}" -O "releases/v${version}.tar.gz" +fi tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}" mv "releases/v${version}/bin/helms3" "bin/helms3" \ No newline at end of file