failsafe optional var, template baserul for downloads

This commit is contained in:
AJ ONeal
2020-05-03 04:37:31 +00:00
parent 3bd0caa95c
commit d117e5c2ae
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -67,6 +67,10 @@ function normalize(all) {
rel.ext = exts[0];
}
}
if (all.download) {
rel.download = all.download.replace(/{{ download }}/, rel.download);
}
});
return all;
}
+1 -1
View File
@@ -50,7 +50,7 @@ WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-go.XXXXXXXX)"}
# The WEBI bootstrap will define these
# but each script should be testable in its own right
if [ -z "${WEBI_PKG_URL}" ]; then
if [ -z "${WEBI_PKG_URL:-}" ]; then
release_tab="${WEBI_HOST}/api/releases/go@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&ext=tar&limit=1"
WEBI_CSV=$(curl -fsSL "$release_tab" -H "User-Agent: $(uname -a)")
WEBI_CHANNEL=$(echo $WEBI_TAB | cut -d ',' -f 3)
+1 -1
View File
@@ -34,7 +34,7 @@ WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-ripgrep.XXXXXXXX)"}
# The WEBI bootstrap will define these
# but each script should be testable in its own right
if [ -z "${WEBI_PKG_URL}" ]; then
if [ -z "${WEBI_PKG_URL:-}" ]; then
release_tab="${WEBI_HOST}/api/releases/ripgrep@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&ext=tar&limit=1"
WEBI_CSV=$(curl -fsSL "$release_tab" -H "User-Agent: $(uname -a)")
WEBI_CHANNEL=$(echo $WEBI_TAB | cut -d ',' -f 3)