1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

ready for linux app :)

This commit is contained in:
Dick Choi
2016-04-04 08:02:53 +09:00
parent 3b9a2c3ee1
commit d7bc5a7088
2 changed files with 32 additions and 21 deletions

View File

@@ -212,10 +212,22 @@ module.exports = function (grunt) {
}
})
grunt.registerTask('build', function (platform) {
if (!platform) {
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
function getTarget () {
switch (process.platform) {
case 'darwin':
return 'osx'
case 'win32':
return 'win'
case 'linux':
return 'linux'
default:
return process.platform
}
}
grunt.registerTask('build', function (platform) {
if (platform == null) platform = getTarget()
switch (platform) {
case 'win':
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
@@ -225,14 +237,13 @@ module.exports = function (grunt) {
break
case 'linux':
grunt.task.run(['compile', 'pack:linux', 'electron-installer-debian'])
break;
break
}
})
grunt.registerTask('pre-build', function (platform) {
if (!platform) {
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
}
if (platform == null) platform = getTarget()
switch (platform) {
case 'win':
grunt.task.run(['compile', 'pack:win'])

View File

@@ -128,12 +128,13 @@ const updater = new GhReleases(ghReleasesOpts)
// Check for updates
// `status` returns true if there is a new update available
function checkUpdate () {
// Disable check update(Linux only)
return true
if (process.platform === 'linux') {
return true
}
updater.check((err, status) => {
if (err) {
console.error(err)
if (!versionNotified) notify('Updater error!', message)
if (!versionNotified) notify('Updater error!', err.message)
}
if (!err) {
if (status) {
@@ -277,18 +278,17 @@ app.on('ready', function () {
mainWindow.hide()
})
// Disable Finder(Linux only)
// if (finderProcess == null && process.platform === 'darwin') {
// spawnFinder()
// } else {
// finderWindow = require('./finder-window')
if (finderProcess == null && process.platform === 'darwin') {
spawnFinder()
} else {
finderWindow = require('./finder-window')
// finderWindow.on('close', function (e) {
// if (appQuit) return true
// e.preventDefault()
// finderWindow.hide()
// })
// }
finderWindow.on('close', function (e) {
if (appQuit) return true
e.preventDefault()
finderWindow.hide()
})
}
nodeIpc.server.start(function (err) {
if (err.code === 'EADDRINUSE') {