You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
* make it easier to download and install
Add a make target `install-tf` that builds and installs where terraform
can find the plugin.
Update download.sh to work with our changes in #34.
* unzip -u
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
70
-
exit 1
71
-
;;
61
+
is_supported_platform() {
62
+
platform=$1
63
+
found=1
64
+
case"$platform"in
65
+
darwin/amd64) found=0 ;;
66
+
linux/amd64) found=0 ;;
72
67
esac
68
+
return$found
69
+
}
70
+
check_platform() {
71
+
if is_supported_platform "$PLATFORM";then
72
+
# optional logging goes here
73
+
true
74
+
else
75
+
log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new"
76
+
exit 1
77
+
fi
73
78
}
74
79
tag_to_version() {
75
80
if [ -z"${TAG}" ];then
@@ -87,7 +92,7 @@ tag_to_version() {
87
92
VERSION=${TAG#v}
88
93
}
89
94
adjust_format() {
90
-
# change format (tar.gz or zip) based on OS
95
+
# change format (tar.gz or zip) based on ARCH
91
96
true
92
97
}
93
98
adjust_os() {
@@ -159,9 +164,7 @@ log_crit() {
159
164
uname_os() {
160
165
os=$(uname -s | tr '[:upper:]''[:lower:]')
161
166
case"$os"in
162
-
cygwin_nt*) os="windows" ;;
163
-
mingw*) os="windows" ;;
164
-
msys_nt*) os="windows" ;;
167
+
msys_nt) os="windows" ;;
165
168
esac
166
169
echo"$os"
167
170
}
@@ -221,15 +224,20 @@ uname_arch_check() {
221
224
untar() {
222
225
tarball=$1
223
226
case"${tarball}"in
224
-
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;;
225
-
*.tar) tar --no-same-owner -xf "${tarball}" ;;
226
-
*.zip) unzip "${tarball}" ;;
227
+
*.tar.gz | *.tgz) tar -xzf "${tarball}" ;;
228
+
*.tar) tar -xf "${tarball}" ;;
229
+
*.zip) unzip -u "${tarball}" ;;
227
230
*)
228
231
log_err "untar unknown archive format for ${tarball}"
229
232
return 1
230
233
;;
231
234
esac
232
235
}
236
+
mktmpdir() {
237
+
test -z "$TMPDIR"&& TMPDIR="$(mktemp -d)"
238
+
mkdir -p "${TMPDIR}"
239
+
echo"${TMPDIR}"
240
+
}
233
241
http_download_curl() {
234
242
local_file=$1
235
243
source_url=$2
@@ -332,8 +340,8 @@ EOF
332
340
PROJECT_NAME="terraform-provider-bless"
333
341
OWNER=chanzuckerberg
334
342
REPO="terraform-provider-bless"
335
-
BINARY=terraform-provider-bless_{{ .Tag }}
336
-
FORMAT=tar.gz
343
+
BINARY=terraform-provider-bless
344
+
FORMAT=zip
337
345
OS=$(uname_os)
338
346
ARCH=$(uname_arch)
339
347
PREFIX="$OWNER/$REPO"
@@ -350,7 +358,7 @@ uname_arch_check "$ARCH"
350
358
351
359
parse_args "$@"
352
360
353
-
get_binaries
361
+
check_platform
354
362
355
363
tag_to_version
356
364
@@ -365,7 +373,7 @@ log_info "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}"
0 commit comments