// This function takes the raw result of a shelljs command and figures out how to print it.
// Invoke this *REGARDLESS* of what the command returns, it will figure it out.
function printCmdRet(ret) {
  // This is way to complicated. It should get much easier once shelljs/shelljs#356 is fixed.
  if (ret) {
    if (typeof ret.stdout !== 'undefined' && typeof ret.stderr !== 'undefined') {
      if (ret.stdout) console.log(ret.stdout);
      if (ret.stderr) console.error(ret.stderr);
    } else if (ret.output) {
      console.log(ret.output);
    } else if (Array.isArray(ret)) {
      console.log(ret.join('\n'));
    } else {
      console.log(ret);
    }
  }
}

module.exports = printCmdRet;

@@ -165,24 +165,21 @@
 it out.%0A
-function
+const
  printCm
@@ -182,23 +182,50 @@
 ntCmdRet
+ = 
 (ret) 
-%7B
+=%3E %7B%0A  if (!ret) return;%0A
 %0A  // Th
@@ -324,96 +324,33 @@
 (ret
-) %7B%0A    if (typeof ret.stdout !== 'undefined' && typeof ret.stderr !== 'undefined'
+.stdout && ret.stderr
 ) %7B%0A
-  
     
@@ -394,18 +394,16 @@
 t);%0A    
-  
 if (ret.
@@ -437,18 +437,16 @@
 tderr);%0A
-  
   %7D else
@@ -460,26 +460,24 @@
 t.output) %7B%0A
-  
     console.
@@ -493,18 +493,16 @@
 utput);%0A
-  
   %7D else
@@ -528,26 +528,24 @@
 ret)) %7B%0A    
-  
 console.log(
@@ -561,18 +561,16 @@
 '%5Cn'));%0A
-  
   %7D else
@@ -576,18 +576,16 @@
 e %7B%0A    
-  
 console.
@@ -600,35 +600,28 @@
 ;%0A  
-  %7D%0A  %7D%0A%7D%0A%0Amodule.exports =
+%7D%0A%7D;%0A%0Aexport default
  pri

update to es6