fix(scripts): add uninstall handlers and sudo-aware removal#38
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Add missing uninstall action to install_go.sh, install_composer.sh, install_docker.sh, and install_parallel.sh. All 14 dedicated scripts now consistently handle install/update/uninstall actions. Fix remove_installation() in reconcile.sh to check directory writability before removal, using sudo for root-owned paths like /usr/local/bin. Closes #36, closes #37 Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- Add sudo availability check in reconcile.sh remove_installation - Narrow sed patterns in install_go.sh to only match export lines - Add sudo check before rm -rf in install_go.sh uninstall - Add test for graceful error when sudo is unavailable Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Change test file permissions from 0o755 (world-executable) to 0o700 (owner-only) in all tests added by this PR. The bash subprocess runs as the same user, so group/other permissions are unnecessary. This resolves a CodeQL "overly permissive file permissions" false positive. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
acd2751 to
b24bc6b
Compare
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_go.sh,install_composer.sh,install_docker.sh, andinstall_parallel.sh— all 14 dedicated scripts now consistently handle install/update/uninstallremove_installation()inreconcile.shto check directory writability before removal, usingsudofor root-owned paths like/usr/local/binCloses #36, closes #37
Test plan
TestDedicatedScriptUninstallHandler: verifies all 14 dedicated scripts parse$1and haveuninstall)caseTestReconcileSudoAwareRemoval: verifies writability check in reconcile.sh, behavioral tests with writable/non-writable dirs