@@ -105,7 +105,7 @@ export function generateInstallScript(
105105 return `#!/bin/bash
106106set -euo pipefail
107107
108- TAP_NAME ="openbootdotdev/tap "
108+ OPENBOOT_REPO ="openbootdotdev/openboot "
109109
110110main() {
111111# When run via "curl | bash", stdin is the script content, not the terminal.
@@ -205,39 +205,48 @@ install_homebrew() {
205205 echo ""
206206}
207207
208- local os arch
209- os=\$(detect_os)
210- arch=\$(detect_arch)
208+ install_openboot() {
209+ local os_name="\$1"
210+ local arch_name="\$2"
211211
212- echo "Detected: \${os}/\${arch}"
213- echo ""
212+ echo "Fetching latest OpenBoot version..."
213+ local latest_version
214+ latest_version=\$(curl -fsSL "https://api.github.com/repos/\${OPENBOOT_REPO}/releases/latest" \\
215+ | grep '"tag_name"' | grep -o 'v[0-9][0-9.]*')
214216
215- install_xcode_clt
216- install_homebrew
217+ if [[ -z "\$latest_version" ]]; then
218+ echo "Error: Could not fetch latest OpenBoot version" >&2
219+ exit 1
220+ fi
221+
222+ local binary_url="https://github.com/\${OPENBOOT_REPO}/releases/download/\${latest_version}/openboot-\${os_name}-\${arch_name}"
217223
218- if brew list openboot &>/dev/null 2>&1; then
219- echo "OpenBoot is already installed via Homebrew."
224+ echo "Installing OpenBoot \${latest_version}..."
220225 echo ""
221- read -p "Reinstall? (y/N) " -n 1 -r
222- echo
223-
224- if [[ \$REPLY =~ ^[Yy]\$ ]]; then
225- echo "Reinstalling OpenBoot..."
226- brew reinstall \${TAP_NAME}/openboot
227- echo ""
228- echo "OpenBoot reinstalled!"
226+
227+ curl -fsSL "\$binary_url" -o /tmp/openboot-install
228+ chmod +x /tmp/openboot-install
229+
230+ if [[ -w "/usr/local/bin" ]]; then
231+ mv /tmp/openboot-install /usr/local/bin/openboot
229232 else
230- echo "Using existing installation."
233+ sudo mv /tmp/openboot-install /usr/local/bin/openboot
231234 fi
232- else
233- echo "Installing OpenBoot via Homebrew..."
235+
234236 echo ""
237+ echo "OpenBoot \${latest_version} installed!"
238+ }
235239
236- brew install \${TAP_NAME}/openboot
240+ local os arch
241+ os=\$(detect_os)
242+ arch=\$(detect_arch)
237243
238- echo ""
239- echo "OpenBoot installed!"
240- fi
244+ echo "Detected: \${os}/\${arch}"
245+ echo ""
246+
247+ install_xcode_clt
248+ install_homebrew
249+ install_openboot "\$os" "\$arch"
241250
242251echo ""
243252echo "Starting OpenBoot setup with config: @${ safeUsername } /${ safeSlug } "
0 commit comments