#!/bin/sh # Keep the bootstrap inside a complete function: truncated stdin must not install. omf_install() ( set -eu command -v node >/dev/null 2>&1 || { echo 'Oh My Feed requires Node.js 22+. / Node.js 22 이상이 필요합니다.' >&2; exit 1; } node -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 22 ? 0 : 1)' || { echo 'Oh My Feed requires Node.js 22+. / Node.js 22 이상이 필요합니다.' >&2 exit 1 } command -v curl >/dev/null 2>&1 || { echo 'curl is required.' >&2; exit 1; } umask 077 omf_install_tmp=$(mktemp -d) trap 'rm -f "$omf_install_tmp/install.mjs"; rmdir "$omf_install_tmp"' 0 trap 'exit 1' HUP INT TERM curl --proto '=https' --tlsv1.2 --fail --silent --show-error --max-time 30 --max-filesize 131072 \ https://ohmyfeed.stream/cli/install.mjs -o "$omf_install_tmp/install.mjs" || exit "$?" node "$omf_install_tmp/install.mjs" "$@" ) (omf_install "$@")