diff --git a/spec/upgrade-spec.js b/spec/upgrade-spec.js index 7b0b5b77..76278749 100644 --- a/spec/upgrade-spec.js +++ b/spec/upgrade-spec.js @@ -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', diff --git a/src/upgrade.js b/src/upgrade.js index afa05077..bfe1ee67 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -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