Permalink
Browse files

Decided I hated returning arrays, changed it to objects

  • Loading branch information...
benbreedlove committed Jan 29, 2013
1 parent 06682e4 commit 634cfa03fddc2227259041a50eae0e3ddcdb7a08
Showing with 11 additions and 7 deletions.
  1. +1 −1 package.json
  2. +7 −3 tasks/gss_pull.js
  3. +1 −1 test/expected/multi_sheet
  4. +1 −1 test/expected/single_sheet
  5. +1 −1 test/expected/super_simple
View
@@ -1,7 +1,7 @@
{
"name": "grunt-gss-pull",
"description": "The best grunt plugin ever.",
- "version": "0.1.0",
+ "version": "0.1.1",
"homepage": "https://github.com/motherjones/grunt-gss-pull",
"author": {
"name": "Ben Breedlove",
View
@@ -137,11 +137,15 @@ module.exports = function(grunt) {
Promise.all( promises ).then(function(results) {
// Write the destination file.
if (results.length === 1) {
- var key = Object.keys(results[0])[0];
- grunt.file.write(fileObj.dest, JSON.stringify(results[0][key])
+ grunt.file.write(fileObj.dest, JSON.stringify(results[0])
);
} else {
- grunt.file.write(fileObj.dest, JSON.stringify(results)
+ var object_to_write = {};
+ for (var i=0; i < results.length; i++) {
+ var key = Object.keys(results[i])[0];
+ object_to_write[key] = results[i][key];
+ }
+ grunt.file.write(fileObj.dest, JSON.stringify(object_to_write)
);
}

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 634cfa0

Please sign in to comment.