Make install.sh run unattended and survive a reinstall - #208
Merged
Merged
Conversation
Add a #!/bin/sh shebang and set -e, create /usr/games with mkdir -p, install git with apt-get -y, and pull an existing clone instead of failing on git clone. Assert the contract from tests/test_installScript.py, since the script needs root and can't be run by the suite or CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (CI run 36687265692 green on the PR head):
Notes:
This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
install.shnow starts with#!/bin/shandset -e, so it names its shell and stops at the first failed step. Before this change, if the git install was declined,/bin/fishewas still written and pointed at a directory that was never cloned./usr/gamesis created withmkdir -p, so theFile existserror no longer appears on Debian/Ubuntu, where the directory is normally present already.apt-get install -y gitremoves the confirmation prompt that stopped non-interactive runs./usr/games/FishE/.gitalready exists, the clone is updated withgit -C … pulland not cloned again, so the script can be run a second time.tests/test_installScript.pychecks these points by reading the script's text, following the approach intests/test_shellEntryPoints.py. The script needs root and changes/usr/gamesand/bin, so neither the suite nor CI can run it.Closes #205
Test plan
os.environ+pytest.main): 923 passedinstall.shstashed back tomain's version, all 5 new tests fail. With the change restored, they pass.sh -n install.shreturns 0This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson