#!/usr/bin/env bash set -o errexit -o nounset -o pipefail # Function to check if a command exists has() { [[ -z $1 ]] && return 1 command -v $1 >/dev/null 2>&1 } echo "Initiating Fluence CLI installation process..." # Determine the operating system and machine architecture OS="$(uname -s | tr '[:upper:]' '[:lower:]')" ARCH="$(uname -m)" # Setting the installation directory for Fluence CLI FLUENCE_USER_DIR="${FLUENCE_USER_DIR-$HOME/.fluence}" # Creating a temporary directory and ensuring its cleanup on script exit TEMP="$(mktemp -d)" trap "rm -rf '$TEMP'" EXIT INT TERM # Ensuring 'curl' is installed for downloading necessary files if ! has "curl"; then echo "Error: Installation requires 'curl'. Please install 'curl' and try again." exit 1 fi # Check that fluence is not installed if has "fluence"; then cat </dev/null); then cat <