Skip to content

Commit

Permalink
Merge pull request #91 from pulsar-edit/no-update-check-on-core-packages
Browse files Browse the repository at this point in the history
Skip update checks for bundled packages
  • Loading branch information
confused-Techie authored Sep 8, 2023
2 parents 0223f66 + 29b64b6 commit de6a852
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/upgrade-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ describe('apm upgrade', () => {
});
});

it('does not display updates for "core" packages', () => {
fs.writeFileSync(path.join(packagesDir, 'core-package', 'package.json'), JSON.stringify({
name: 'core-package',
version: '1.0',
repository: 'https://github.com/pulsar-edit/pulsar'
}));
const callback = jasmine.createSpy('callback');
apm.run(['upgrade', '--list', '--no-color'], callback);

waitsFor('waiting for upgrade to complete', 600000, () => callback.callCount > 0);

runs(() => {
expect(console.log).toHaveBeenCalled();
expect(console.log.argsForCall[1][0]).toContain('empty');
});
});

it('does not display updates for packages whose engine does not satisfy the installed Atom version', () => {
fs.writeFileSync(path.join(packagesDir, 'test-module', 'package.json'), JSON.stringify({
name: 'test-module',
Expand Down
6 changes: 6 additions & 0 deletions src/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ available updates.\
}

getLatestVersion(pack, callback) {
// We want to bail on checking for updates of any packages that come with the editor
// This can generally be detected by checking if the repository is that of Pulsar itself
if (pack.repository === "https://github.com/pulsar-edit/pulsar") {
return callback();
}

const requestSettings = {
url: `${config.getAtomPackagesUrl()}/${pack.name}`,
json: true
Expand Down

0 comments on commit de6a852

Please sign in to comment.