Skip to content

Commit

Permalink
[pulsar-updater] Don't prompt to update on non-default release channe…
Browse files Browse the repository at this point in the history
…ls (#1185)

* [pulsar-updater] Don't prompt to update on non-default release channels

* [pulsar-updater] Fix spec
  • Loading branch information
savetheclocktower authored Jan 7, 2025
1 parent 316dfd1 commit 64ec928
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/pulsar-updater/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Since a major part of the functionality of this package is attempting to determi
* Universal: Developer Mode
* Universal: Safe Mode
* Universal: Spec Mode
* Universal: Developer Instance
* Universal: Custom Release Channel
* Windows: Chocolatey Installation
* Windows: winget Installation
* Windows: User Installation
Expand Down
4 changes: 2 additions & 2 deletions packages/pulsar-updater/spec/find-install-method-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ describe("find-install-method main", async () => {
const platform = process.platform;
const arch = process.arch;

it("Returns developer instance if applicable", async () => {
it("Returns custom release channel if applicable", async () => {
// We can't mock the atom api return from a package,
// So we will just know that if tests are running, it's in the Atom SpecMode

let method = await findInstallMethod();

expect(method.installMethod).toBe("Developer Instance");
expect(method.installMethod).toBe("Custom Release Channel");
expect(method.platform).toBe(platform);
expect(method.arch).toBe(arch);
});
Expand Down
11 changes: 7 additions & 4 deletions packages/pulsar-updater/src/find-install-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ async function main() {
returnValue = "Spec Mode";
}

if (atom.getVersion().endsWith("-dev")) {
if (atom.getReleaseChannel() !== 'stable') {
// This would only be the case if
// 1. `yarn start` was used by a developer
// 2. Someone built a local binary without removing `-dev` from the version
returnValue = "Developer Instance";
//
// * `yarn start` was used by a developer,
// * someone built a local binary without removing `-dev` from the version,
// or
// * someone was using a preview build of PulsarNext.
returnValue = 'Custom Release Channel';
}

if (returnValue.length > 0) {
Expand Down
5 changes: 1 addition & 4 deletions packages/pulsar-updater/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,10 @@ class PulsarUpdater {
break;
case "Safe Mode":
return null;
break;
case "Spec Mode":
return null;
break;
case "Developer Instance":
case "Custom Release Channel":
return null;
break;
case "Flatpak Installation":
returnText += "Install the latest version by running `flatpak update`.";
break;
Expand Down

0 comments on commit 64ec928

Please sign in to comment.