Shuo/src/command-line/config.js

16 lines
308 B
JavaScript
Raw Normal View History

2014-08-19 01:53:17 +00:00
var program = require("commander");
var child = require("child_process");
2014-09-13 16:41:11 +00:00
var CONFIG_PATH = process.cwd() + "/config.js";
2014-09-09 20:06:26 +00:00
2014-08-19 01:53:17 +00:00
program
.command("config")
2014-09-09 20:06:26 +00:00
.description("Edit config: '" + CONFIG_PATH + "'")
2014-08-19 01:53:17 +00:00
.action(function() {
child.spawn(
"sudo",
2014-09-09 20:06:26 +00:00
["vi", CONFIG_PATH],
2014-08-19 01:53:17 +00:00
{stdio: "inherit"}
);
});