@@ -15,7 +15,7 @@ _ok() {
15
15
SYS_ENV_PLATFORM=linux_arm
16
16
else
17
17
echo " This installer does not currently support your platform. If you believe it should, please consider opening an issue on the GitHub repository:"
18
- echo " https://github.com/timo-reymann/circleci-orb- deterministic-zip/issues/new"
18
+ echo " https://github.com/timo-reymann/deterministic-zip/issues/new"
19
19
exit 1
20
20
fi
21
21
@@ -28,9 +28,16 @@ _ok() {
28
28
_ok
29
29
fi
30
30
31
- echo -n " Fetch the latest version from GitHub ... "
32
- # shellcheck disable=SC1083
33
- latest_version=" $( curl -Lso /dev/null -w %{url_effective} https://github.com/timo-reymann/deterministic-zip/releases/latest | grep -o ' [^/]*$' ) "
31
+ if [ -n " $DETERMINISTIC_ZIP_VERSION " ];
32
+ then
33
+ echo -n " Using version from DETERMINISTIC_ZIP_VERSION ..."
34
+ version=" $DETERMINISTIC_ZIP_VERSION "
35
+ else
36
+ echo -n " Fetch the latest version from GitHub ... "
37
+ # shellcheck disable=SC1083
38
+ version=" $( curl -Lso /dev/null -w %{url_effective} https://github.com/timo-reymann/deterministic-zip/releases/latest | grep -o ' [^/]*$' ) "
39
+ fi
40
+
34
41
_ok
35
42
36
43
echo -n " Determine artifact to download based on host OS ... "
@@ -48,8 +55,8 @@ _ok() {
48
55
esac
49
56
_ok
50
57
51
- echo -n " Download binary for ${latest_version } ... "
52
- curl -LsS https://github.com/timo-reymann/deterministic-zip/releases/download/${latest_version } /${artifact} -o /tmp/deterministic-zip.${_pid}
58
+ echo -n " Download binary for ${version } ... "
59
+ curl --fail - LsS https://github.com/timo-reymann/deterministic-zip/releases/download/${version } /${artifact} -o /tmp/deterministic-zip.${_pid} || { echo -e " \n\033[0;31mERR: Failed to download from https://github.com/timo-reymann/deterministic-zip/releases/download/ ${version} / ${artifact} \033[0m " && exit 2 ; }
53
60
_ok
54
61
55
62
echo -n " Installing to /usr/local/bin ..."
0 commit comments