#!/usr/bin/env node
import { echo, exec, exit } from 'shelljs';
echo(process.cwd());

const buildApplication = 'npm run build:dist';
if (exec(buildApplication).code !== 0) {
  echo('Error: build:dist error.');
  exit(1);
}

const cleanOutPutPath = 'node node_modules/rimraf/bin.js ./output';
if (exec(cleanOutPutPath).code !== 0) {
  echo('Error: clean output error.');
  exit(1);
}

const nwjsVersion = '0.12.2';
const buildTarget = ['win32', 'win64', 'osx32', 'osx64', 'linux32', 'linux64'];
const nodeWebkitBuilder = 'node node_modules/node-webkit-builder/bin/nwbuild'+
  ` -v '${nwjsVersion}'` +
  ` -p '${buildTarget.join(',')}'` +
  ' ./dist' +
  ' -o ./output';
if (exec(nodeWebkitBuilder).code !== 0) {
  echo('Error: nwbuild error.');
  exit(1);
}

@@ -413,27 +413,25 @@
 ;%0Aconst 
-buildTarget
+platforms
  = %5B'win
@@ -508,32 +508,39 @@
 tBuilder = 'node
+' +%0A  '
  node_modules/no
@@ -576,17 +576,24 @@
 '+%0A  %60 -
-v
+-version
  '$%7Bnwjs
@@ -614,24 +614,31 @@
  %60 -
-p '$%7BbuildTarget
+-platforms '$%7Bplatforms
 .joi
@@ -668,17 +668,25 @@
  +%0A  ' -
-o
+-buildDir
  ./outpu

use long option