Fixing newlines in shell scripts

This helps the partials tests pass
This commit is contained in:
Tyler Akins 2015-01-26 15:08:23 -06:00
parent e41ec5bbb3
commit fcc04bc4d6

View File

@ -4,7 +4,10 @@ var async, exec, fs, summary, specFiles;
function makeShellString(value) { function makeShellString(value) {
if (typeof value === 'string') { if (typeof value === 'string') {
return JSON.stringify(value); // Newlines are tricky
return value.split(/\n/).map(function (chunk) {
return JSON.stringify(chunk);
}).join('"\n"');
} }
if (typeof value === 'number') { if (typeof value === 'number') {