From 2d583d6ea075947efdf0a97442b2a56daf578014 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 20 Jun 2013 15:25:26 -0700 Subject: [PATCH] Use local spawn method to output all errors --- Gruntfile.coffee | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index a695976da..ed7cac593 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -151,18 +151,18 @@ module.exports = (grunt) -> grunt.registerTask 'copy-info-plist', 'Copy plist', -> done = @async() - grunt.util.spawn cmd: 'script/copy-info-plist', args: [BUILD_DIR], (error, result, code) -> + spawn cmd: 'script/copy-info-plist', args: [BUILD_DIR], (error, result, code) -> done(error) grunt.registerTask 'set-development-version', "Sets version to current sha", -> done = @async() - grunt.util.spawn cmd: 'script/set-version', args: [BUILD_DIR], (error, result, code) -> + spawn cmd: 'script/set-version', args: [BUILD_DIR], (error, result, code) -> done(error) grunt.registerTask 'codesign', 'Codesign the app', -> done = @async() args = ["-f", "-v", "-s", "Developer ID Application: GitHub", SHELL_APP_DIR] - grunt.util.spawn cmd: "codesign", args: args, (error) -> done(error) + spawn cmd: "codesign", args: args, (error) -> done(error) grunt.registerTask 'install', 'Install the built application', -> rm INSTALL_DIR @@ -173,19 +173,19 @@ module.exports = (grunt) -> done = @async() commands = [] commands.push (callback) -> - grunt.util.spawn cmd: 'script/bootstrap', (error) -> callback(error) + spawn cmd: 'script/bootstrap', (error) -> callback(error) commands.push (callback) -> - grunt.util.spawn cmd: 'script/update-atom-shell', (error) -> callback(error) + spawn cmd: 'script/update-atom-shell', (error) -> callback(error) grunt.util.async.waterfall commands, (error) -> done(error) grunt.registerTask 'test', 'Run the specs', -> done = @async() commands = [] commands.push (callback) -> - grunt.util.spawn cmd: 'pkill', args: ['Atom'], -> callback() + spawn cmd: 'pkill', args: ['Atom'], -> callback() commands.push (callback) -> atomBinary = path.join(CONTENTS_DIR, 'MacOS', 'Atom') - grunt.util.spawn cmd: atomBinary, args: ['--test', "--resource-path=#{__dirname}"], (error) -> callback(error) + spawn cmd: atomBinary, args: ['--test', "--resource-path=#{__dirname}"], (error) -> callback(error) grunt.util.async.waterfall commands, (error) -> done(error) grunt.registerTask('compile', ['coffee', 'less', 'cson']) @@ -194,6 +194,11 @@ module.exports = (grunt) -> grint.registerTask('deploy', ['clean', 'bootstrap', 'build', 'codesign']) grunt.registerTask('default', ['build', 'install']) + spawn = (options, callback) -> + grunt.util.spawn options, (error, results, code) -> + grunt.log.errorlns results.stderr if results.stderr + callback(error, results, code) + cp = (source, destination, {filter}={}) -> copyFile = (source, destination) -> if grunt.file.isLink(source)