Repository navigation
docs: install Keploy without writing a script in the working directory - #253
Merged
Merged
Conversation
Twelve READMEs told users to install Keploy with `curl --silent -O -L https://keploy.io/install.sh && source install.sh` (http-postgres and postgres-wire-features split it over two lines; go-twilio and mux-mysql fetch keploy/keploy's main keploy.sh the same way, as ./keploy.sh). curl -O saves the installer in the working directory, so run from a repository root it overwrote the repository's own file of that name before the installer even started. Each now says source /dev/stdin <<<"$(curl -fsSL URL || echo '...; return 1')" with the echoed script `echo Keploy installer download failed >&2`. It writes no file and is still sourced, so the PATH the installer sets stays set 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 instead of going on without keploy. The URLs are unchanged. The change is mechanical: putting the old command back in each changed line gives the old line byte for byte (the two-line forms become one line; mux-sql keeps its CRLF line ending). 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
Twelve READMEs install Keploy with a command that saves the installer in the working directory first:
curl --silent -O -L https://keploy.io/install.sh && source install.sh(8);curl --silent -O -L https://keploy.io/install.shthensource install.sh(http-postgres, postgres-wire-features);curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh(go-twilio, mux-mysql), which saves./keploy.sh.curl -Osaves the installer in the working directory. Run from a repository root, it overwrote the repository's own file of that name before any installer code ran, so no installer fix can prevent it.What changed
Each command now reads
source /dev/stdin <<<"$(curl -fsSL URL || echo 'echo Keploy installer download failed >&2; return 1')", with URL as it was.source install.sh./bin/bash3.2 sources<(curl ...)as an empty file, returns 0 and installs nothing.Keploy installer download failed, and the command returns 1, so the failure shows at the install line and not as a later "keploy: command not found".How it was checked
curl ... -O ... install.sh|keploy.shorsource install.sh|keploy.shis left in the repository.install.sh,keploy.shandkeploy-enterprise.sh, with only the URL swapped: a stub installer over file://, or the real URL with.no-such-fileappended (a real 404 from keploy.io or raw.githubusercontent.com). Shapes: a terminal (SHELL -c),bash -e FILE,bash --noprofile --norc -eo pipefail FILE, and a script on stdin afterset -eo pipefail.git statusstays empty.-ethe step stops at the install line.curl -O ... && source install.shandcurl -O ... keploy.sh && source keploy.shleave the repo dirty (the tracked file overwritten).-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;keploy/keploy/main/keploy.shURL did the same.Control: the old
curl --silent -O -L https://keploy.io/install.sh && source install.shline leaves the repo dirty (its owncurl -Ooverwrites install.sh).Stated limits
source install.shdid.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. The installer keeps its top-level code in its last lines (from line 516 of 596 on 2026-11-01), so a part that arrived mostly defines functions.Files touched (one command each)
book-store-inventory/README.md, echo-sql/README.md, fasthttp-postgres/README.md, gin-mongo/README.md, go-jwt/README.md, go-twilio/README.md, http-postgres/README.md (2 lines become 1), mux-elasticsearch/README.md, mux-mysql/readme.md, mux-sql/README.md (CRLF line ending kept), postgres-wire-features/README.md (2 lines become 1), users-profile/README.md.
Not changed
curl --silent --location ".../keploy_linux_*.tar.gz" | tar xz -C /tmp(.gitpod.yml, gin-redis/README.md): it writes into /tmp, not the working directory.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.