#!/bin/sh # Proton CLI installer: curl -fsSL https://app.proton.computer/install.sh | sh # Installs one Python file to ~/.local/bin/proton (override with PROTON_INSTALL_DIR). set -eu url="${PROTON_CLI_URL:-https://app.proton.computer/cli/proton}" dir="${PROTON_INSTALL_DIR:-$HOME/.local/bin}" if ! command -v python3 >/dev/null 2>&1; then echo "proton: Python 3.8 or newer is required." >&2 echo " macOS: xcode-select --install Ubuntu/Debian: sudo apt install python3" >&2 exit 1 fi if ! python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))'; then echo "proton: Python 3.8 or newer is required (found $(python3 -V 2>&1))." >&2 exit 1 fi command -v ssh >/dev/null 2>&1 || echo "proton: warning: OpenSSH client not found; install it to use 'proton ssh'." >&2 mkdir -p "$dir" tmp="$(mktemp "$dir/.proton.XXXXXX")" trap 'rm -f "$tmp"' EXIT curl -fsSL --proto '=https' --tlsv1.2 "$url" -o "$tmp" python3 -c 'import ast,sys; ast.parse(open(sys.argv[1]).read())' "$tmp" chmod 755 "$tmp" mv "$tmp" "$dir/proton" trap - EXIT echo "Installed $("$dir/proton" --version) to $dir/proton" case ":$PATH:" in *":$dir:"*) ;; *) echo "Add it to your PATH: export PATH=\"$dir:\$PATH\"" ;; esac echo "Next: proton login"