Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading