Repository navigation
Conversation
flock install and flock uninstall exit with 4 when the administrator password or permission prompt is declined, instead of 1. The macOS, Linux and Windows apps read the exit status instead of matching the English message, which is unchanged.
This branch has not been deployed
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.
Fixes #25
What changed
flock installandflock uninstallexit with4when the administrator password or permission prompt is declined (on macOS, Linux and Windows), instead of1.errDeclinedand the newExitCodelive ininternal/cli/exitcodes.go;cmd/flock/main.goexits withcli.ExitCode(err).3is already taken byexitNotWorktreeandexitAlreadyRunning, and pkexec uses 126/127, so the next free code is4. The message printed in the terminal is unchanged.Installation.Resultkeeps the process'sstatus;permissionDeclinedisstatus == 4. The uninstall sheet usespermissionDeclinedinstead of matching the text.Outputkeeps the exitcode;declined()iscode == Some(4).Installation.Resultkeeps theExitCodethatCliProcessRunneralready reports; the setup window usesPermissionDeclinedinstead of matching the text.docs/cli.mddocuments the exit statuses offlock installandflock uninstall.Tests
TestExitCode(declined, declined and wrapped, another error, and the same text withouterrDeclined).1isn't counted as declined.Run locally (macOS, Apple silicon):
make lint,make test,GOOS=windows go vet ./...,GOOS=linux go vet ./...,swift build/swift test --package-path macos,cargo fmt --checkandgo run ./tools/docslint. The Linux app (GTK) and the Windows app (net10.0-windows) can't build on macOS, so their build and tests are left to CI.