#!/bin/sh # # Downloads the latest Volary CLI from the download site and installs it. set -e VERSION=`curl -fsSL https://download.volary.ai/latest_version` OS=`uname` if [ "$OS" = "Linux" ]; then OS="linux" elif [ "$OS" = "Darwin" ]; then OS="darwin" else echo "Unknown operating system $OS" exit 1 fi ARCH=`uname -m` if [ "$ARCH" = "x86_64" ]; then ARCH="amd64" elif [ "$ARCH" = "amd64" ]; then : elif [ "$ARCH" = "arm64" ]; then : elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64" else echo "Unsupported cpu arch $ARCH" exit 1 fi URL="https://download.volary.ai/sdk/${VERSION}/vol_${OS}_${ARCH}" if [ "$XDG_CACHE_HOME" != "" ]; then DEST_DIR="$XDG_CACHE_HOME/volary.ai" else DEST_DIR="$HOME/.cache/volary.ai" fi mkdir -p "$DEST_DIR" DEST="${DEST_DIR}/vol" echo "Downloading the volary.ai CLI from ${URL}..." curl -fsSLo "$DEST" "$URL" chmod +x "$DEST" echo echo "The Volary CLI has been downloaded to $DEST and can be run from there" echo "Alternatively you can use `alias vol="$DEST"` to run it as 'vol' directly." echo echo "You might also want to set up command-line completion for it." echo "To do so, add this line to your ~/.bashrc or ~/.zshrc:" echo " source <($DEST completion)"