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:
25
gruntfile.js
25
gruntfile.js
@@ -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'])
|
||||
|
||||
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user