#!/bin/sh set -e # Verify Node.js 22+ NODE_MAJOR=$( (node --version 2>/dev/null || echo "") | sed 's/v//' | cut -d. -f1 ) if [ -z "$NODE_MAJOR" ] || [ "$NODE_MAJOR" -lt 22 ]; then echo "cooked requires Node.js 22 or higher." echo "Install or upgrade Node.js: https://nodejs.org" exit 1 fi # Download INSTALL_DIR="$HOME/.local/bin" mkdir -p "$INSTALL_DIR" curl -fsSL "https://gitlab.com/codes.sjf/hellotilda/-/raw/main/tool/bin/cooked" -o "$INSTALL_DIR/cooked" chmod +x "$INSTALL_DIR/cooked" # PATH hint case ":$PATH:" in *":$INSTALL_DIR:"*) ;; *) echo "" echo "Add ~/.local/bin to your PATH:" echo " echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.profile" echo " source ~/.profile" ;; esac echo "" echo "cooked installed successfully." "$INSTALL_DIR/cooked" --version echo "" echo "Get started: cooked init"