From a6aa40b1c148737511747c8514e6d529a7f48f36 Mon Sep 17 00:00:00 2001 From: David White Date: Thu, 9 Oct 2014 09:27:36 +0100 Subject: [PATCH] Fix missing Helper method in edit and use $EDITOR * Fix the missing Helper method in the edit command to use Helper.HOME and the correct path assembly method (path.join) instead of joining strings together! * Use $EDITOR instead of "vi" in the event a user doesn't have "vi" installed or doesn't understand it. Fallback to "vi" in case user doesn't have $EDITOR set. --- src/command-line/edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command-line/edit.js b/src/command-line/edit.js index 8bde2656..6330cd72 100644 --- a/src/command-line/edit.js +++ b/src/command-line/edit.js @@ -15,8 +15,8 @@ program return; } child.spawn( - "vi", - [Helper.resolveHomePath("users", name, "user.json")], + process.env.EDITOR || "vi", + [require("path").join(Helper.HOME, "users", name, "user.json")], {stdio: "inherit"} ); });