CLI installer says to use bash when piped into sh (#205)
* CLI installer: say to use bash when piped into sh; Claude and Codex docs use | bash
- CI / Typecheck and bundlesuccess
- CI / Unit tests (1/2)success
- CI / Unit tests (2/2)success
- Deploy / Deploy to Cloudflaresuccess
- Deploy / Main's current tipsuccess
- End-to-end / End-to-end (agent reviews, tasks, Today)Failed
- End-to-end / End-to-end (git, PRs, Actions)Failed
- End-to-end / End-to-end (large pushes)Failed
- End-to-end / End-to-end (passkeys, registry, email)Failed
- End-to-end / End-to-end (real histories)Failed
- End-to-end / End-to-end (security)Failed
- Live test / Containers, registry, sandboxes, webhooks, schedules, LFS and pull requestssuccess
3 files changed+8−1
modifiedapps/cli/install/install.sh+6−0View file
| @@ -8,6 +8,12 @@ | ||
| 8 | 8 | # Node.js 22 or later: the one on your PATH when it's new enough, otherwise a private copy of the |
| 9 | 9 | # Node.js LTS from nodejs.org, checked against its published SHA-256, in ~/.diffinery/node. |
| 10 | 10 | # Run it again, or `diffinery upgrade`, to update. Served by Diffinery from apps/cli/install/. |
| 11 | + | |
| 12 | +# Piped into sh instead of bash, a shell like dash stops at `set -o pipefail` with no hint why. | |
| 13 | +if [ -z "${BASH_VERSION:-}" ]; then | |
| 14 | + echo "This installer needs bash: curl -fsSL __DIFFINERY_URL__/install | bash" >&2 | |
| 15 | + exit 1 | |
| 16 | +fi | |
| 11 | 17 | set -euo pipefail |
| 12 | 18 | |
| 13 | 19 | server=${DIFFINERY_URL:-__DIFFINERY_URL__} |
modifiedapps/diffinery/docs/agents/claude-and-codex.md+1−1View file
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | The MCP tools need no git at all. When Claude Code works in a clone instead, give it the CLI once: |
| 52 | 52 | |
| 53 | 53 | ```sh |
| 54 | -curl -fsSL https://diffinery.com/install | sh # Windows: irm https://diffinery.com/install.ps1 | iex | |
| 54 | +curl -fsSL https://diffinery.com/install | bash # Windows: irm https://diffinery.com/install.ps1 | iex | |
| 55 | 55 | diffinery login # browser sign-in, or --device on a server |
| 56 | 56 | diffinery auth setup-git # git push and pull use the same sign-in |
| 57 | 57 | diffinery auth setup-gh # gh, and Claude Code's pull request and CI status |
modifiedapps/diffinery/test/unit/docs.test.ts+1−0View file
| @@ -220,6 +220,7 @@ | ||
| 220 | 220 | expect(sh).toMatch(/^#!\/usr\/bin\/env bash\n/); |
| 221 | 221 | expect(sh).toContain(`server=\${DIFFINERY_URL:-${ORIGIN}}`); |
| 222 | 222 | expect(sh).not.toContain("__DIFFINERY_URL__"); |
| 223 | + expect(sh).toContain(`curl -fsSL ${ORIGIN}/install | bash`); // what to run when piped into sh | |
| 223 | 224 | } |
| 224 | 225 | const ps1 = await (await get("/install.ps1")).text(); |
| 225 | 226 | expect(ps1).toContain(`'${ORIGIN}'`); |