#!/bin/sh # okay.txt for your terminal (macOS 14+). Usage: curl -fsSL https://okaytxt.com/install.sh | sh # Installs the `txt` command into ~/.local/bin. Remove it any time: rm ~/.local/bin/txt set -e if [ "$(uname -s)" != "Darwin" ]; then echo "okay.txt for the terminal is Mac only for now. try https://okaytxt.com/app"; exit 1; fi dir="$HOME/.local/bin" mkdir -p "$dir" echo "downloading okay.txt…" curl -fsSL https://okaytxt.com/dl/okaytxt-macos -o "$dir/txt.tmp" chmod +x "$dir/txt.tmp" mv "$dir/txt.tmp" "$dir/txt" # the old command name keeps working for anyone who installed it before ln -sf "$dir/txt" "$dir/okaytxt" echo "installed: $dir/txt" case ":$PATH:" in *":$dir:"*) echo "run: txt" ;; *) echo "add it to your PATH: echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.zshrc && exec zsh" echo "then run: txt" ;; esac