-#!/usr/bin/env node
+#!/usr/bin/env nodejs
-const cli = require('../lib/cli');
-cli(process.argv);
+var fs = require('fs');
+var path = require('path');
+
+// get current path of execution
+var execPath = process.cwd();
+
+// get real path because it can be real bin file or symbolic link file
+var binDir = path.dirname(fs.realpathSync(process.argv[1]));
+
+// change cwd
+process.chdir(path.join(binDir, '..', 'lib'));
+
+// babel for es6
+require('babel-core/register');
+
+// compile & execute
+require('../lib/cli')(process.argv, execPath);
* Promises: http://www.html5rocks.com/en/tutorials/es6/promises/
* q: https://github.com/kriskowal/q
*/
-function cli(inputArgv) {
+function cli(inputArgv, execPath) {
// verify inputArgv
const argv = getVerifiedArgv(inputArgv);
if (argv === null) {
return;
}
- // add exec path
- const execPath = process.cwd();
argv.exec_path_ = execPath;
// setup manifest parser
const parser = new (require('./parser'))(execPath);
- // get real path because it can be real bin file or symbolic link file
- const binDir = path.dirname(fs.realpathSync(process.argv[1]));
-
- // change cwd
- process.chdir(path.join(binDir, '..', 'lib'));
-
// process command
switch (argv.cmd_) {
case 'create':
"bin": {
"jsn-cli": "./bin/jsn-cli"
},
- "engines": { "node": ">= 4.2.1" },
+ "engines": {
+ "node": ">= 0.10.25"
+ },
"dependencies": {
- "elementtree": "0.1.6",
- "pretty-data": "0.40.0",
- "q": "1.4.1",
- "shelljs": "0.5.3",
- "string-template": "0.2.1"
- },
- "author": { "name": "Yongseop Kim", "email": "yons.kim@samsung.com" },
+ "babel-core": "^6.1.19",
+ "babel-preset-es2015": "^6.1.18",
+ "elementtree": "0.1.6",
+ "pretty-data": "0.40.0",
+ "q": "1.4.1",
+ "shelljs": "0.5.3",
+ "string-template": "0.2.1"
+ },
+ "babel": {
+ "presets": [
+ "es2015"
+ ]
+ },
+ "author": {
+ "name": "Yongseop Kim",
+ "email": "yons.kim@samsung.com"
+ },
"contributors": [
- { "name": "Yongseop Kim", "email": "yons.kim@samsung.com" },
- { "name": "Joonghyun Cho", "email": "jh5.cho@samsung.com" }
+ {
+ "name": "Yongseop Kim",
+ "email": "yons.kim@samsung.com"
+ },
+ {
+ "name": "Joonghyun Cho",
+ "email": "jh5.cho@samsung.com"
+ }
]
}