Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1784 from adobe/glenn/update-notification
Browse files Browse the repository at this point in the history
Don't show update notification when running from GitHub source
  • Loading branch information
jasonsanjose committed Oct 8, 2012
2 parents 82ef833 + 9ab99e4 commit 1e0bbe7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define(function (require, exports, module) {
Global = require("utils/Global");

// Extract current build number from package.json version field 0.0.0-0
var _buildNumber = /-([0-9]+)/.exec(brackets.metadata.version)[1];
var _buildNumber = Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);

// PreferenceStorage
var _prefs = PreferencesManager.getPreferenceStorage(module.id, {lastNotifiedBuildNumber: 0});
Expand Down Expand Up @@ -283,6 +283,15 @@ define(function (require, exports, module) {
// Get all available updates
var allUpdates = _stripOldVersionInfo(versionInfo, _buildNumber);

// When running directly from GitHub source (as opposed to
// an installed build), _buildNumber is 0. In this case, if the
// test is not forced, don't show the update notification icon or
// dialog.
if (_buildNumber === 0 && !force) {
result.resolve();
return;
}

if (allUpdates) {
// Always show the "update available" icon if any updates are available
var $updateNotification = $("#update-notification");
Expand Down

0 comments on commit 1e0bbe7

Please sign in to comment.