Repository navigation
feat: install the stablebar command from Settings - #256
Merged
Merged
Conversation
Settings → General → Command line shows whether the first stablebar on the login shell's PATH runs this app. Otherwise Install writes /usr/local/bin/stablebar, a script that runs the app's executable, and asks for an administrator password only when the folder needs one. A command that StableBar didn't write is never replaced. The guide explains it and how to remove it. Closes #255
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
The command line is the app's own executable,
StableBar.app/Contents/MacOS/StableBar, and nothing puts it onPATH, so the guide'sStableBar --queryexamples fail withcommand not found. Closes #255.Changes
CommandLineToolSettings.swift), below Configuration file:stablebaron the login shell'sPATHruns this app, whether StableBar wrote it or it links to the app./usr/local/bin/stablebar, a marked two-line script that runs this app's executable with every argument. A script rather than a link, so the app runs from its bundle as it does now.stablebarthat StableBar didn't write; it is never replaced, andinstallchecks that again before writing.CommandLineTool.swift) writes directly when the folder is writable. Otherwise it runsmkdir -pandinstall -m 755throughosascript'sdo shell script … with administrator privileges, with the command and prompt passed as arguments rather than spliced into the AppleScript. Cancelling the password prompt (-128) does nothing; other failures show in red under the row.docs/command-line.md, linked from its intro and from the General paragraph indocs/settings.md.No configuration properties change, so decoding, layers, editing and examples don't apply.
Testing
swift test --filter CommandLineTool: 14 new tests.$HOMEunchanged, and names the app it runs, including paths with spaces and quotes.PATHwins; directories and non-executable files are skipped; the install folder is checked when it isn't onPATH.swift test: 314 XCTest and 448 Swift Testing tests pass./usr/local/binand/usr/localfails withCocoaError.fileWriteNoPermission, which leads to the prompt; the AppleScript compiles withosacompile; a cancel reports(-128)./usr/local/bin/stablebaron the developer's Mac.Screenshots were drawn offscreen from scratch files, so paths are under
/tmp; a real install shows/usr/local/bin/stablebar. The test runner isn't in Applications, so Install shows disabled with its hint.Each state: installed, another copy, another command, and not installed outside Applications.
Merging
One commit whose message matches the title, so any merge method works.
Claude Opus 5.5 via Claude Code