#!/bin/sh # Installs the healthsql command: one Python file with no dependencies. https://healthsql.app # curl -fsSL https://healthsql.app/install | sh # It puts the file in ~/.local/bin (or $HEALTHSQL_BIN), then runs `healthsql setup`. set -eu dir="${HEALTHSQL_BIN:-$HOME/.local/bin}" if ! command -v python3 >/dev/null 2>&1 || ! python3 -c 'import sys; sys.exit(sys.version_info < (3, 9))' 2>/dev/null; then echo "healthsql needs Python 3.9 or later. On a Mac, run: xcode-select --install" >&2 exit 1 fi mkdir -p "$dir" curl -fsSL "https://healthsql.app/healthsql" -o "$dir/healthsql.new" chmod +x "$dir/healthsql.new" mv "$dir/healthsql.new" "$dir/healthsql" echo "Installed $dir/healthsql" >&2 case ":$PATH:" in *":$dir:"*) ;; *) echo "Note: $dir is not on your PATH. Use the full path, or add it to your shell profile." >&2 ;; esac exec "$dir/healthsql" setup