mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge branch 'master' into as-public-ci
This commit is contained in:
@@ -3,9 +3,30 @@ CSON = require 'season'
|
||||
fs = require 'fs-plus'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
OtherPlatforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32'].filter (platform) -> platform isnt process.platform
|
||||
|
||||
module.exports = (grunt) ->
|
||||
{spawn, rm} = require('./task-helpers')(grunt)
|
||||
|
||||
getMenu = (appDir) ->
|
||||
menusPath = path.join(appDir, 'menus')
|
||||
menuPath = path.join(menusPath, "#{process.platform}.json")
|
||||
menu = CSON.readFileSync(menuPath) if fs.isFileSync(menuPath)
|
||||
rm menusPath
|
||||
menu
|
||||
|
||||
getKeymaps = (appDir) ->
|
||||
keymapsPath = path.join(appDir, 'keymaps')
|
||||
keymaps = {}
|
||||
for keymapPath in fs.listSync(keymapsPath, ['.json'])
|
||||
name = path.basename(keymapPath, path.extname(keymapPath))
|
||||
continue unless OtherPlatforms.indexOf(name) is -1
|
||||
|
||||
keymap = CSON.readFileSync(keymapPath)
|
||||
keymaps[path.basename(keymapPath)] = keymap
|
||||
rm keymapsPath
|
||||
keymaps
|
||||
|
||||
grunt.registerTask 'compile-packages-slug', 'Add bundled package metadata information to the main package.json file', ->
|
||||
appDir = fs.realpathSync(grunt.config.get('atom.appDir'))
|
||||
|
||||
@@ -50,5 +71,7 @@ module.exports = (grunt) ->
|
||||
|
||||
metadata = grunt.file.readJSON(path.join(appDir, 'package.json'))
|
||||
metadata._atomPackages = packages
|
||||
metadata._atomMenu = getMenu(appDir)
|
||||
metadata._atomKeymaps = getKeymaps(appDir)
|
||||
|
||||
grunt.file.write(path.join(appDir, 'package.json'), JSON.stringify(metadata))
|
||||
|
||||
@@ -139,4 +139,4 @@ module.exports = (grunt) ->
|
||||
if process.platform is 'win32' and process.env.JANKY_SHA1
|
||||
done()
|
||||
else
|
||||
done(!coreSpecFailed and failedPackages.length == 0)
|
||||
done(not coreSpecFailed and failedPackages.length is 0)
|
||||
|
||||
@@ -55,9 +55,9 @@ module.exports = (grunt) ->
|
||||
proc.stderr.on 'data', (data) -> stderr.push(data.toString())
|
||||
proc.on 'error', (processError) -> error ?= processError
|
||||
proc.on 'close', (exitCode, signal) ->
|
||||
error ?= new Error(signal) if exitCode != 0
|
||||
error ?= new Error(signal) if exitCode isnt 0
|
||||
results = {stderr: stderr.join(''), stdout: stdout.join(''), code: exitCode}
|
||||
grunt.log.error results.stderr if exitCode != 0
|
||||
grunt.log.error results.stderr if exitCode isnt 0
|
||||
callback(error, results, exitCode)
|
||||
|
||||
isAtomPackage: (packagePath) ->
|
||||
|
||||
Reference in New Issue
Block a user