mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 02:36:36 +00:00
ready for linux app :)
This commit is contained in:
25
gruntfile.js
25
gruntfile.js
@@ -212,10 +212,22 @@ module.exports = function (grunt) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
grunt.registerTask('build', function (platform) {
|
function getTarget () {
|
||||||
if (!platform) {
|
switch (process.platform) {
|
||||||
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
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) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
|
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
|
||||||
@@ -225,14 +237,13 @@ module.exports = function (grunt) {
|
|||||||
break
|
break
|
||||||
case 'linux':
|
case 'linux':
|
||||||
grunt.task.run(['compile', 'pack:linux', 'electron-installer-debian'])
|
grunt.task.run(['compile', 'pack:linux', 'electron-installer-debian'])
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
grunt.registerTask('pre-build', function (platform) {
|
grunt.registerTask('pre-build', function (platform) {
|
||||||
if (!platform) {
|
if (platform == null) platform = getTarget()
|
||||||
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
|
||||||
}
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
grunt.task.run(['compile', 'pack:win'])
|
grunt.task.run(['compile', 'pack:win'])
|
||||||
|
|||||||
@@ -128,12 +128,13 @@ const updater = new GhReleases(ghReleasesOpts)
|
|||||||
// Check for updates
|
// Check for updates
|
||||||
// `status` returns true if there is a new update available
|
// `status` returns true if there is a new update available
|
||||||
function checkUpdate () {
|
function checkUpdate () {
|
||||||
// Disable check update(Linux only)
|
if (process.platform === 'linux') {
|
||||||
return true
|
return true
|
||||||
|
}
|
||||||
updater.check((err, status) => {
|
updater.check((err, status) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
if (!versionNotified) notify('Updater error!', message)
|
if (!versionNotified) notify('Updater error!', err.message)
|
||||||
}
|
}
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (status) {
|
if (status) {
|
||||||
@@ -277,18 +278,17 @@ app.on('ready', function () {
|
|||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Disable Finder(Linux only)
|
if (finderProcess == null && process.platform === 'darwin') {
|
||||||
// if (finderProcess == null && process.platform === 'darwin') {
|
spawnFinder()
|
||||||
// spawnFinder()
|
} else {
|
||||||
// } else {
|
finderWindow = require('./finder-window')
|
||||||
// finderWindow = require('./finder-window')
|
|
||||||
|
|
||||||
// finderWindow.on('close', function (e) {
|
finderWindow.on('close', function (e) {
|
||||||
// if (appQuit) return true
|
if (appQuit) return true
|
||||||
// e.preventDefault()
|
e.preventDefault()
|
||||||
// finderWindow.hide()
|
finderWindow.hide()
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
|
|
||||||
nodeIpc.server.start(function (err) {
|
nodeIpc.server.start(function (err) {
|
||||||
if (err.code === 'EADDRINUSE') {
|
if (err.code === 'EADDRINUSE') {
|
||||||
|
|||||||
Reference in New Issue
Block a user