Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions apps/marketing/public/cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,27 @@ download_tarball() {
target="$1"
tarball="superset-${target}.tar.gz"

latest_url="https://github.com/${REPO}/releases/download/cli-latest/${tarball}"
if [ "$TAG" = "latest" ]; then
url="https://github.com/${REPO}/releases/download/cli-latest/${tarball}"
url="$latest_url"
else
url="https://github.com/${REPO}/releases/download/${TAG}/${tarball}"
fi

info "Downloading $url"
tmp="$(mktemp -t superset-install.XXXXXX)"
if ! curl -fsSL -o "$tmp" "$url"; then
rm -f "$tmp"
error "Failed to download $url"
# Some desktop versions have no CLI release, and `hosts add` asks for its own version.
if [ "$url" = "$latest_url" ]; then
rm -f "$tmp"
error "Failed to download $url"
fi
warn "No CLI release ${TAG} for ${target}. Installing the latest release."
info "Downloading $latest_url"
if ! curl -fsSL -o "$tmp" "$latest_url"; then
rm -f "$tmp"
error "Failed to download $latest_url"
fi
fi
echo "$tmp"
}
Expand Down
Loading