Skip to content

install.sh: staging install fails on macOS (BSD sed \s incompatibility + env var pipe scoping) #250

@santoshkumarradha

Description

@santoshkumarradha

Problem

install.sh --staging fails on macOS with curl: (3) URL rejected: Malformed input to a URL function.

Two root causes:

1. BSD sed \s incompatibility (Critical)

get_latest_prerelease_version() uses \s* in the sed regex (lines 234, 241):

sed -E 's/.*"tag_name":\s*"([^"]+)".*/\1/'

\s is a GNU sed extension. macOS ships BSD sed where \s matches literal s, not whitespace. The regex fails to match, sed returns the entire raw JSON line, and VERSION becomes:

    "tag_name": "v0.1.48-rc.2",	    "prerelease": true,

This gets interpolated into the download URL → malformed URL → curl rejects it.

Note: get_latest_stable_version() does NOT have this bug — it uses sed -E 's/.*"([^"]+)".*/\1/' (no \s).

2. Documentation: VERSION=X curl ... | bash pipe scoping

The documented version pinning pattern doesn't work:

# Documented (BROKEN) — VERSION scopes to curl, not bash
VERSION=v0.1.48-rc.2 curl -fsSL https://agentfield.ai/install.sh | bash

In POSIX shells, VAR=val cmd1 | cmd2 sets VAR only for cmd1. The bash process executing the script never sees VERSION.

Affected locations:

  • scripts/install.sh line 6
  • docs/RELEASE.md lines 200, 210, 213

Reproduction

# On macOS:
curl -fsSL https://agentfield.ai/install.sh | bash -s -- --staging
# Output: "Installing STAGING version:     "tag_name": "v0.1.48-rc.2", ..."
# Error:  curl: (3) URL rejected: Malformed input to a URL function

Fix

  1. Replace \s* with POSIX [[:space:]]* in both sed patterns
  2. Fix documented env var patterns to curl ... | VERSION=X bash

Environment

  • macOS 15 (Apple Silicon)
  • bash 5.x / zsh 5.9
  • AgentField v0.1.47 installed, attempting upgrade to v0.1.48-rc.2

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions