#!/bin/sh # ctx installer: curl -fsSL https://ctx.ferrorium.com/install.sh | sh set -eu REPO="iamhuman-cheolheelee/ctx" DIR="${CTX_INSTALL_DIR:-$HOME/.local/bin}" os=$(uname -s); arch=$(uname -m) case "$os-$arch" in Darwin-arm64) t=aarch64-apple-darwin ;; Darwin-x86_64) t=x86_64-apple-darwin ;; Linux-x86_64) t=x86_64-unknown-linux-musl ;; Linux-aarch64|Linux-arm64) t=aarch64-unknown-linux-musl ;; *) echo "ctx: unsupported platform $os-$arch" >&2; exit 1 ;; esac url="https://github.com/$REPO/releases/latest/download/ctx-$t.tar.gz" tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT echo "ctx: downloading $url" curl -fsSL "$url" -o "$tmp/ctx.tar.gz" tar -xzf "$tmp/ctx.tar.gz" -C "$tmp" mkdir -p "$DIR" install -m 755 "$tmp/ctx" "$DIR/ctx" echo "ctx: installed to $DIR/ctx" "$DIR/ctx" --version || true case ":$PATH:" in *":$DIR:"*) ;; *) echo "ctx: add to PATH -> export PATH=\"$DIR:\$PATH\"" ;; esac