2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2014-08-19 01:53:17 +00:00
|
|
|
var program = require("commander");
|
|
|
|
var child = require("child_process");
|
2014-10-01 16:43:46 +00:00
|
|
|
var Helper = require("../helper");
|
2014-08-19 01:53:17 +00:00
|
|
|
|
|
|
|
program
|
|
|
|
.command("config")
|
2016-05-08 06:21:31 +00:00
|
|
|
.description("Edit config: " + Helper.CONFIG_PATH)
|
2014-08-19 01:53:17 +00:00
|
|
|
.action(function() {
|
2016-09-20 05:33:09 +00:00
|
|
|
var child_spawn = child.spawn(
|
2014-10-09 12:40:16 +00:00
|
|
|
process.env.EDITOR || "vi",
|
2016-05-08 06:21:31 +00:00
|
|
|
[Helper.CONFIG_PATH],
|
2014-08-19 01:53:17 +00:00
|
|
|
{stdio: "inherit"}
|
|
|
|
);
|
2016-09-20 05:33:09 +00:00
|
|
|
child_spawn.on("error", function() {
|
|
|
|
log.error("Unable to open " + Helper.CONFIG_PATH + ". $EDITOR is not set, and vi was not found.");
|
|
|
|
});
|
2014-08-19 01:53:17 +00:00
|
|
|
});
|