mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 08:17:16 +00:00
Handle stderr when using edit or config command, fixes #164
This commit is contained in:
parent
c090ab065f
commit
e6bf20de2f
2 changed files with 8 additions and 2 deletions
|
@ -6,9 +6,12 @@ program
|
|||
.command("config")
|
||||
.description("Edit config: " + Helper.CONFIG_PATH)
|
||||
.action(function() {
|
||||
child.spawn(
|
||||
var child_spawn = child.spawn(
|
||||
process.env.EDITOR || "vi",
|
||||
[Helper.CONFIG_PATH],
|
||||
{stdio: "inherit"}
|
||||
);
|
||||
child_spawn.on("error", function() {
|
||||
log.error("Unable to open " + Helper.CONFIG_PATH + ". $EDITOR is not set, and vi was not found.");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,9 +12,12 @@ program
|
|||
log.error("User '" + name + "' doesn't exist.");
|
||||
return;
|
||||
}
|
||||
child.spawn(
|
||||
var child_spawn = child.spawn(
|
||||
process.env.EDITOR || "vi",
|
||||
[Helper.getUserConfigPath(name)],
|
||||
{stdio: "inherit"}
|
||||
);
|
||||
child_spawn.on("error", function() {
|
||||
log.error("Unable to open " + Helper.getUserConfigPath(name) + ". $EDITOR is not set, and vi was not found.");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue