diff --git a/src/command-line/config.js b/src/command-line/config.js index 1fef7dde..9488d507 100644 --- a/src/command-line/config.js +++ b/src/command-line/config.js @@ -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."); + }); }); diff --git a/src/command-line/edit.js b/src/command-line/edit.js index 5d849eb9..7b2ca558 100644 --- a/src/command-line/edit.js +++ b/src/command-line/edit.js @@ -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."); + }); });