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.
This commit is contained in:
David White 2014-10-09 09:27:36 +01:00
parent 06517e7dac
commit a6aa40b1c1
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ program
return; return;
} }
child.spawn( child.spawn(
"vi", process.env.EDITOR || "vi",
[Helper.resolveHomePath("users", name, "user.json")], [require("path").join(Helper.HOME, "users", name, "user.json")],
{stdio: "inherit"} {stdio: "inherit"}
); );
}); });