Repository navigation
docs: install Keploy without writing keploy.sh in the working directory - #155
Merged
Merged
Conversation
Five READMEs told users to install Keploy with `curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh`. curl -O saves the installer as ./keploy.sh, so run from a repository root it overwrote the repository's own keploy.sh 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 URL is unchanged. 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>
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
Five READMEs install Keploy with
curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh, which saves./keploy.shfirst.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):keploy/keploy/main/keploy.shURL installed Keploy, the next line found and ran$HOME/.keploy/bin/keploy, andgit statusstayed empty.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)
employee-manager/README.md, spring-boot-postgres-graphql/README.md, spring-boot-product-catalog/README.md, spring-petclinic/README.md, user-manager/README.md.
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.