hardlounge/src/command-line/config.js

20 lines
495 B
JavaScript
Raw Normal View History

"use strict";
2014-08-19 01:53:17 +00:00
var program = require("commander");
var child = require("child_process");
var Helper = require("../helper");
2014-08-19 01:53:17 +00:00
program
.command("config")
.description("Edit config: " + Helper.CONFIG_PATH)
2014-08-19 01:53:17 +00:00
.action(function() {
var child_spawn = child.spawn(
process.env.EDITOR || "vi",
[Helper.CONFIG_PATH],
2014-08-19 01:53:17 +00:00
{stdio: "inherit"}
);
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
});