install.sh
Standard CLI installer script
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-256a8bcacd0f33fda5b1c83b48a9bb64be7c1fdae85bf936cd5dea2426c7a8b92f5
MaleculeH₆(Cm₁₁Db₂F₁₄Os₅Po₄U₃)Md(Pt₂)
Evidence
1#!/usr/bin/env sh
2# Paysio CLI installer.
3#
4# curl -fsSL https://paysio.com/install.sh | sh
5#
6# Downloads a standalone binary (no Node required). Set PAYSIO_INSTALL_DIR to
7# choose where it lands, or PAYSIO_VERSION to pin a version.
8set -eu
9
10CDN="${PAYSIO_CDN:-https://cdn.paysio.com/cli}"
11INSTALL_DIR="${PAYSIO_INSTALL_DIR:-$HOME/.paysio/bin}"
12
13red() { printf '\033[31m%s\033[0m\n' "$1" >&2; }
14green() { printf '\033[32m%s\033[0m\n' "$1"; }
15dim() { printf '\033[2m%s\033[0m\n' "$1"; }
16
17os="$(uname -s)"
18arch="$(uname -m)"
19
20case "$os" in
21 Darwin)
22 case "$arch" in
23 arm64|aarch64) asset="paysio-darwin-arm64" ;;
24 x86_64) asset="paysio-darwin-x64" ;;
25 *) red "Unsupported macOS architecture: $arch"; exit 1 ;;
26 esac
⋯6 lines
33 ;;
34 MINGW*|MSYS*|CYGWIN*)
35 red "On Windows, install with PowerShell instead:"
36 red " irm https://paysio.com/install.ps1 | iex"
37 red "Or use npm: npm install -g paysio"
38 exit 1
39 ;;
⋯5 lines
45esac
46
47# Resolve the version to install.
48#
55:41… someone remembering to purge a cache.
56version="${PAYSIO_VERSION:-}"
57if [ -z "$version" ]; then
58 dim "Resolving the latest version..."
59 version="$(curl -fsSL https://registry.npmjs.org/paysio/latest 2>/dev/null \
60 | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' \
61 | head -n 1 || true)"
62fi
63
64if [ -n "$version" ]; then
65 url="$CDN/$version/$asset"
66else
67 # npm unreachable (offline, firewall). Fall back to the mutable folder, which
68 # is rig …
99:45… ight read, not just one, because zsh
100# and bash split them by shell type and picking one silently misses the others:
101#
102# .zshrc interactive shells only -- a terminal window
103# .zprofile login shells -- `zsh -l -c`, ssh, some CI runners
113:63… asted into
114# someone's .zshrc. (rustup does the same thing with ~/.cargo/env, for the same
115# reason.) The first version of this installer inlined the logic, and changing
116# it turned into a migration problem immediately.
117PAYSIO_HOME="$HOME/.paysio"
118ENV_FILE="$PAYSIO_HOME/env"
119ENV_FISH="$PAYSIO_HOME/env.fish"
120
121posix_line="[ -f \"\$HOME/.paysio/env\" ] && . \"\$HOME/.paysio/env\""
122fish_line="test -f \"\$HOME/.paysio/env.fish\"; and source \"\$HOME/.paysio/env.fish\""
123
124mkdir -p "$PAYSIO_HOME"
125
126# REMOVE-then-PREPEND, not skip-if-present.
127#
128# The obvious "only add it if it is missing" guard is wrong here. In a login
129# shell zsh reads .zprofile first (which puts us on PATH) and .zshrc second …
132:8… dy on PATH, just no longer first. The result is that a stale
133# `npm i -g paysio` keeps winning and the user sees the old version forever.
134#
135# Stripping our entry and re-prepending gives both propertie …