Skip to content

Commit d7bc5a7

Browse files
committed
ready for linux app :)
1 parent 3b9a2c3 commit d7bc5a7

2 files changed

Lines changed: 33 additions & 22 deletions

File tree

gruntfile.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,22 @@ module.exports = function (grunt) {
212212
}
213213
})
214214

215-
grunt.registerTask('build', function (platform) {
216-
if (!platform) {
217-
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
215+
function getTarget () {
216+
switch (process.platform) {
217+
case 'darwin':
218+
return 'osx'
219+
case 'win32':
220+
return 'win'
221+
case 'linux':
222+
return 'linux'
223+
default:
224+
return process.platform
218225
}
226+
}
227+
228+
grunt.registerTask('build', function (platform) {
229+
if (platform == null) platform = getTarget()
230+
219231
switch (platform) {
220232
case 'win':
221233
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
@@ -225,14 +237,13 @@ module.exports = function (grunt) {
225237
break
226238
case 'linux':
227239
grunt.task.run(['compile', 'pack:linux', 'electron-installer-debian'])
228-
break;
240+
break
229241
}
230242
})
231243

232244
grunt.registerTask('pre-build', function (platform) {
233-
if (!platform) {
234-
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
235-
}
245+
if (platform == null) platform = getTarget()
246+
236247
switch (platform) {
237248
case 'win':
238249
grunt.task.run(['compile', 'pack:win'])

lib/main-app.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ const updater = new GhReleases(ghReleasesOpts)
128128
// Check for updates
129129
// `status` returns true if there is a new update available
130130
function checkUpdate () {
131-
// Disable check update(Linux only)
132-
return true
131+
if (process.platform === 'linux') {
132+
return true
133+
}
133134
updater.check((err, status) => {
134135
if (err) {
135136
console.error(err)
136-
if (!versionNotified) notify('Updater error!', message)
137+
if (!versionNotified) notify('Updater error!', err.message)
137138
}
138139
if (!err) {
139140
if (status) {
@@ -277,18 +278,17 @@ app.on('ready', function () {
277278
mainWindow.hide()
278279
})
279280

280-
// Disable Finder(Linux only)
281-
// if (finderProcess == null && process.platform === 'darwin') {
282-
// spawnFinder()
283-
// } else {
284-
// finderWindow = require('./finder-window')
285-
286-
// finderWindow.on('close', function (e) {
287-
// if (appQuit) return true
288-
// e.preventDefault()
289-
// finderWindow.hide()
290-
// })
291-
// }
281+
if (finderProcess == null && process.platform === 'darwin') {
282+
spawnFinder()
283+
} else {
284+
finderWindow = require('./finder-window')
285+
286+
finderWindow.on('close', function (e) {
287+
if (appQuit) return true
288+
e.preventDefault()
289+
finderWindow.hide()
290+
})
291+
}
292292

293293
nodeIpc.server.start(function (err) {
294294
if (err.code === 'EADDRINUSE') {

0 commit comments

Comments
 (0)