mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
cab654ec48
Summary: - We now build sqlite3 manually from source in script/bootstrap - We now allow queries to run in parallel outside of transaction blocks - When signining in and out, the main window creates the database file and then advances the database "phase", which allows all the windows to connect to the initialized database. This diff also fixes T2411 where popout drafts opened twice, and several issues around Windows icons and install. Test Plan: Run existing tests Reviewers: evan Reviewed By: evan Maniphest Tasks: T2411 Differential Revision: https://phab.nylas.com/D1815
57 lines
1.9 KiB
CoffeeScript
57 lines
1.9 KiB
CoffeeScript
fs = require 'fs'
|
|
path = require 'path'
|
|
|
|
module.exports = (grunt) ->
|
|
{spawn} = require('./task-helpers')(grunt)
|
|
|
|
getVersion = (callback) ->
|
|
onBuildMachine = process.env.JANKY_SHA1 and process.env.JANKY_BRANCH is 'master'
|
|
inRepository = fs.existsSync(path.resolve(__dirname, '..', '..', '.git'))
|
|
{version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
|
|
if onBuildMachine or not inRepository
|
|
callback(null, version)
|
|
else
|
|
cmd = 'git'
|
|
args = ['rev-parse', '--short', 'HEAD']
|
|
spawn {cmd, args}, (error, {stdout}={}, code) ->
|
|
commitHash = stdout?.trim?()
|
|
combinedVersion = "#{version}-#{commitHash}"
|
|
callback(error, combinedVersion)
|
|
|
|
grunt.registerTask 'set-version', 'Set the version in the plist and package.json', ->
|
|
done = @async()
|
|
|
|
getVersion (error, version) ->
|
|
if error?
|
|
done(error)
|
|
return
|
|
|
|
appDir = grunt.config.get('atom.appDir')
|
|
|
|
# Replace version field of package.json.
|
|
packageJsonPath = path.join(appDir, 'package.json')
|
|
packageJson = require(packageJsonPath)
|
|
packageJson.version = version
|
|
packageJsonString = JSON.stringify(packageJson)
|
|
fs.writeFileSync(packageJsonPath, packageJsonString)
|
|
|
|
if process.platform is 'darwin'
|
|
cmd = 'script/set-version'
|
|
args = [grunt.config.get('atom.buildDir'), version]
|
|
spawn {cmd, args}, (error, result, code) -> done(error)
|
|
|
|
else if process.platform is 'win32'
|
|
shellAppDir = grunt.config.get('atom.shellAppDir')
|
|
shellExePath = path.join(shellAppDir, 'nylas.exe')
|
|
|
|
strings =
|
|
CompanyName: 'Nylas, Inc.'
|
|
FileDescription: 'Nylas'
|
|
LegalCopyright: 'Copyright (C) 2014-2015 Nylas, Inc. All rights reserved'
|
|
ProductName: 'Nylas'
|
|
ProductVersion: version
|
|
|
|
rcedit = require('rcedit')
|
|
rcedit(shellExePath, {'version-string': strings}, done)
|
|
else
|
|
done()
|