File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ] )
Original file line number Diff line number Diff 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
130130function 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' ) {
You can’t perform that action at this time.
0 commit comments