Skip to content

Commit 34afea8

Browse files
committed
Merge pull request electron#138 from electron/use-cross-platform-update-url
Auto update cleanup
2 parents 9eb02b2 + 30531a8 commit 34afea8

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

auto-updater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ exports.initialize = function () {
2929
exports.updateMenu()
3030
})
3131

32-
autoUpdater.setFeedURL('https://electron-api-demos.githubapp.com/%3Cspan%20class="x x-first x-last">mac')
32+
autoUpdater.setFeedURL('https://electron-api-demos.githubapp.com/%3Cspan%20class="x x-first x-last">updates')
3333
autoUpdater.checkForUpdates()
3434
}
3535

main-process/menus/application-menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function addUpdateMenuItems (items, position) {
136136
}
137137
}, {
138138
label: 'Restart and Install Update',
139-
enabled: false,
139+
enabled: true,
140140
visible: false,
141141
key: 'restartToUpdate',
142142
click: function () {

main.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ function initialize () {
1717
var shouldQuit = makeSingleInstance()
1818
if (shouldQuit) return app.quit()
1919

20-
// Require and setup each JS file in the main-process dir
21-
glob(path.join(__dirname, 'main-process/**/*.js'), function (error, files) {
22-
if (error) return console.log(error)
23-
files.forEach(function (file) {
24-
require(file)
25-
})
26-
autoUpdater.updateMenu()
27-
})
28-
2920
function createWindow () {
3021
var windowOptions = {
3122
width: 1080,
@@ -51,6 +42,7 @@ function initialize () {
5142
}
5243

5344
app.on('ready', function () {
45+
loadDemos()
5446
createWindow()
5547
autoUpdater.initialize()
5648
})
@@ -84,6 +76,15 @@ function makeSingleInstance () {
8476
})
8577
}
8678

79+
// Require each JS file in the main-process dir
80+
function loadDemos() {
81+
var files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))
82+
files.forEach(function (file) {
83+
require(file)
84+
})
85+
autoUpdater.updateMenu()
86+
}
87+
8788
// Handle Squirrel on Windows startup events
8889
switch (process.argv[1]) {
8990
case '--squirrel-install':

0 commit comments

Comments
 (0)