[pulsar-updater] Don't prompt to update on non-default release channels #1185
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.
For PulsarNext I had tied myself in knots trying to guarantee that Pulsar would always know which release channel it was running in — e.g., that PulsarNext would never try to use
~/.pulsar
asATOM_HOME
, and Pulsar would never think thatppm-next
was the binary it should run to find out which packages the user had installed.I should've done the simplest thing first and leaned into the release channel infrastructure that was already in place from the Atom days. If your version number ends in
-foo
, then you're in the-foo
release channel. So the version1.124.12345678-next
is recognized as belonging to thenext
release channel, and the existingatom.getReleaseChannel()
method makes this easy to inspect from anywhere in the core or in package code.But once I did this and rebuilt PulsarNext,
pulsar-updater
pushed me to upgrade! That's because it only checked for the-dev
string at the end of the version, rather than any non-standard release channels.The default return value is
stable
— that's the release channel you'll receive when the version number is something like1.124.0
and you callatom.getReleaseChannel()
. So that's the change I made. It should work equally well in the-dev
case, since that makes Pulsar think we're in a release channel calleddev
.