diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 98337f7a8..bbfd9a3df 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -2,7 +2,6 @@ fs = require 'fs' path = require 'path' _ = require 'underscore' -CSON = require 'season' BUILD_DIR = '/tmp/atom-build/atom-shell' APP_NAME = 'Atom.app' @@ -94,6 +93,8 @@ module.exports = (grunt) -> ext: '.css' cson: + options: + rootObject: true glob_to_multiple: expand: true src: [ @@ -154,26 +155,11 @@ module.exports = (grunt) -> grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-lesslint') + grunt.loadNpmTasks('grunt-cson') grunt.loadNpmTasks('grunt-contrib-csslint') grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-contrib-less') - grunt.registerMultiTask 'cson', 'Compile CSON files to JSON', -> - for mapping in @files - source = mapping.src[0] - destination = mapping.dest - try - object = CSON.readFileSync(source) - if !_.isObject(object) or _.isArray(object) - grunt.log.error("#{source} does not contain a root object") - return false - mkdir path.dirname(destination) - CSON.writeFileSync(destination, object) - grunt.log.writeln("File #{destination.cyan} created.") - catch e - grunt.log.error("Parsing #{source} failed: #{e.message}") - return false - grunt.registerTask 'postbuild', 'Run postbuild scripts', -> done = @async() diff --git a/package.json b/package.json index 3d6d20f47..01524363f 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "grunt-cli": "~0.1.9", "grunt-coffeelint": "0.0.6", "grunt-lesslint": "0.4.0", + "grunt-cson": "0.2.0", "grunt-contrib-csslint": "~0.1.2", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-less": "~0.5.2"