Repository navigation
docs: install Keploy without writing install.sh in the working directory - #946
Merged
Merged
Conversation
The docs told users to install Keploy with `curl --silent -O -L https://keploy.io/install.sh && source install.sh` (or `&& bash install.sh` in the Jenkins pages). curl -O saves the installer as ./install.sh, so run from a repository root it overwrote the repository's own install.sh before the installer even started. The 79 lines in 42 files now say, where the script was sourced: source /dev/stdin <<<"$(curl -fsSL URL || echo '...; return 1')" and in the Jenkins pages, where it was run with bash: (curl -fsSL URL || echo '...; exit 1') | bash with the echoed script `echo Keploy installer download failed >&2`. Neither writes a file. The sourced form still sets PATH in the user's shell; it reads a here-string because macOS's bash 3.2 sources `<(curl ...)` as an empty file. A failed download prints the message and returns 1, so a CI step stops at the install line instead of going on without keploy. The URLs are unchanged; the two Windows pages that had no -L now follow redirects like the rest. The change is mechanical: putting the old command back in each changed line gives the old line byte for byte. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
Three GitHub Actions steps piped the installer to bash without --fail: - version-3.0.0 running-keploy/api-testing-cicd.md: `curl --silent -L https://keploy.io/ent/install.sh | bash`; - version-4.0.0 quickstart/k8s-proxy-developer-workflow.md (2 lines): `curl -sSL https://keploy.io/install.sh | bash`. A download that gets no response (DNS, refused, timeout) hands bash an empty script, so the step passes with nothing installed. An HTTP error hands bash the site's HTML error page to run. They now show the form the other piped lines use: (curl -fsSL URL || echo 'echo Keploy installer download failed >&2; exit 1') | bash with each line's own URL. Any failed download prints the message and fails the step. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Installers: both installers already stopped touching the caller's folder: keploy/enterprise#3166 (released in v3.8.105, served at keploy.io/ent/install.sh) and keploy/keploy#5025 (merged 2026-11-01, served at keploy.io/install.sh). This PR fixes the commands themselves: their
curl -Osaved the installer into the working directory before any installer code ran. Nothing else has to merge first.What was wrong
The docs told users to install Keploy with
curl --silent -O -L https://keploy.io/install.sh && source install.sh(5 pages usehttps://keploy.io/ent/install.sh; the Jenkins pages run it with&& bash install.sh).curl -Osaves the installer as./install.sh. Run from a repository root, as the CI pages do, it overwrote the repository's owninstall.shbefore any installer code ran, so no installer fix can prevent it.What changed
82 lines in 44 files. Each line keeps its text; only the command changes, and the URL stays the same.
llms-full-root.txt):source /dev/stdin <<<"$(curl -fsSL https://keploy.io/install.sh || echo 'echo Keploy installer download failed >&2; return 1')"It is still sourced, so the PATH the installer sets stays set in the user's shell. It reads a here-string because macOS's
/bin/bash3.2 sources<(curl ...)as an empty file and installs nothing.sh '''...'''steps and one note in jenkins.md):(curl -fsSL https://keploy.io/install.sh || echo 'echo Keploy installer download failed >&2; exit 1') | bashKeploy installer download failed, and the command returns 1. A CI step (bash -e, GitLab'sset -eo pipefail, Jenkins'sh -xe) stops at the install line instead of going on without keploy. A barecurl -fsSL URL | bashwould return 0 there.text: "..."props the quotes are escaped as\", as github.md already does.--fail: version-3.0.0 running-keploy/api-testing-cicd.md:49 (curl --silent -L https://keploy.io/ent/install.sh | bash) and version-4.0.0 quickstart/k8s-proxy-developer-workflow.md:139 and :189 (curl -sSL https://keploy.io/install.sh | bash). A download that got no response (DNS, refused, timeout) handed bash an empty script, so the step passed with nothing installed; an HTTP error handed bash the site's HTML error page to run. They now use the piped form above, each with its own URL (second commit).curl --silent -Owithout-L; they now follow redirects like the rest.cd ~ &&stays in front of the 4 Lima commands. It moved off the read-only macOS mount; it is no longer needed, but the change stays mechanical.Files touched (lines changed)
How it was checked
curl -O ... install.sh,source install.shorbash install.shis left.{#id}heading ids stripped as Docusaurus does), before and after.npx prettier@2.8.8 --check(this repo's PR check) passes on the 41 files.run: |block.install.sh, with only the URL swapped (a stub over file://, a failing stub, or a 404 on keploy.io). Shapes: a terminal, GitHub Actions'bash -e FILEandshell: bash(-eo pipefail), GitLab's script on stdin withset -eo pipefail, and Jenkins'sh -xe FILE.git statusstays empty, nothing is left in$HOME.install.shoverwritten).run:lines parse as YAML to the command exactly; the third sits in arun: |block. All 43 changed .md files compile with MDX 3 + GFM.bash -eand-eo pipefail, GitLab'sset -eo pipefailandsh -eunder dash: 102 rows, 0 failures, on Linux amd64 (dash, bash 5.2, zsh 5.9) and on macOS 26.7 (/bin/sh, /bin/dash, /bin/bash 3.2, /bin/zsh 5.9). The ent piped URL gives the same rows as the OSS one: 404 = status 1, the message, the step stops; repo clean.-escript run from the root of a temp git repo that tracks install.sh, keploy.sh and keploy-enterprise.sh, with HOME and TMPDIR fresh (telemetry posts dropped; the binary served from one cached copy of the live download):https://keploy.io/install.shcommand installed Keploy, the next line found and ran$HOME/.keploy/bin/keploy, andgit statusstayed empty;https://keploy.io/ent/install.shcommand installed Keploy, the next line found and ran$HOME/.keploy/bin/keploy, andgit statusstayed empty;https://keploy.io/install.shline installed Keploy into~/.keploy/binand left the repo clean.Control: the old
curl --silent -O -L https://keploy.io/install.sh && source install.shline leaves the repo dirty (its owncurl -Ooverwrites install.sh).Not changed
install.sh(common-errors.md:281, cli-commands.md:74, github.md:26).Stated limits
curl -O ... && bash install.shworked in fish;( ... ) | bashdoes not, because( ... )is a command substitution there. The sourced form needs bash or zsh, assource install.shdid. No fish was available to check.curl | shinstall does; a cut inside a comment, a quoted string or a here-document swallows the message line, and the status is then the partial script's. The oldcurl -O ... && ...ran nothing after curl failed. Both installers keep their top-level code in their last lines (keploy.io/install.sh from line 516 of 596, keploy.io/ent/install.sh from line 810 of 914, on 2026-11-01), so a part that arrived mostly defines functions.-e, a failed install returns 1 and the shell goes on, as a terminal should.Same fix elsewhere
The same command is being replaced, one PR per repo, in keploy/keploy, keploy/enterprise, keploy/api-server, keploy/enterprise-ui, keploy/vscode-extension-enterprise, keploy/vscode-extension, keploy/docs, keploy/landing, keploy/homebrew-tap, keploy/orderflow, keploy/bruno, and the READMEs of keploy/samples-go, samples-python, samples-typescript, samples-csharp, samples-java and samples-rust. keploy/website and the JetBrains plugin also show the old command, but they are not live, so they were skipped.