Repository navigation
Verified installs, run --best, and red-zone alerts - #6
Merged
Merged
Conversation
release.yml only builds; nothing verified a change before this. Runs on Windows (the platform the tool targets first) and Linux (the platform the release builds run on).
release.yml now publishes a sha256sum manifest beside the binaries, and all three install paths check what they download against it before putting it on the PATH: ccswitch upgrade, install.ps1, and a new install.sh one-liner for macOS/Linux. A release from before the manifest existed downgrades to a loud warning; once a manifest is present, a mismatch or an unlisted asset is fatal and the temp file is removed.
An account's score is its most-used window, since that's the one that will stop you first; lower wins, and a tie goes to the most recently used account. Usage is fetched for all signed-in profiles in parallel; accounts whose usage can't be read are skipped rather than guessed at. Prints what it picked and why before launching.
The watch panel is most useful when it isn't in view, so a window crossing 90% now rings the terminal bell and posts a desktop notification: a WinRT toast on Windows, Notification Center via osascript on macOS, notify-send on Linux. Notification failures are silent; the bell always fires. One crossing is one alert: the first sighting of a window only records where it is, staying in the red stays quiet, and a window has to drop back below the threshold before it can alert again.
Also ignore the *.exe~ aside binary that ccswitch upgrade leaves behind until the next launch.
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.
Four additions that make ccswitch safer to install and more useful to leave running:
Checksum-verified installs
release.ymlpublishes aSHA256SUMSmanifest beside the release binaries.ccswitch upgrade,install.ps1, and a newinstall.sh(curl-one-liner for macOS/Linux) all verify what they download against it before installing. Releases predating the manifest get a loud warning; once a manifest exists, a mismatch or unlisted asset is fatal and the temp file is cleaned up.ccswitch run --bestFetches usage for every signed-in profile in parallel and launches the one with the most rate-limit headroom. Score is the most-used window (the one that stops you first), ties go to the most recently used account, unreadable accounts are skipped, and it prints what it picked and why.
Red-zone alerts in the watch panel
A window crossing 90% rings the terminal bell and posts a desktop notification — WinRT toast on Windows, Notification Center on macOS,
notify-sendon Linux. One crossing is one alert: first sighting only records state, and a window re-arms only after dropping back below the threshold. Covered byTestCheckAlertsFiresOncePerCrossing.CI
New
ci.ymlrunsgo vet+go teston Windows and Linux for every push and PR — release.yml only builds, so nothing verified changes before this.Tests:
go vet ./...,go build ./...,go test ./...all pass locally on Windows.