Merge pull request #259 from theVDude/master

Fix edit command
This commit is contained in:
Mattias Erming 2014-10-27 22:49:14 +01:00
commit 02d43ad896
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ var Helper = require("../helper");
program
.command("edit <name>")
.description("Edit user: '" + Helper.HOME + "/users/<name>/user.json'")
.description("Edit user: '" + Helper.HOME + "/users/<name>.json'")
.action(function(name) {
var users = new ClientManager().getUsers();
if (users.indexOf(name) === -1) {
@ -16,7 +16,7 @@ program
}
child.spawn(
process.env.EDITOR || "vi",
[require("path").join(Helper.HOME, "users", name, "user.json")],
[require("path").join(Helper.HOME, "users", name + ".json")],
{stdio: "inherit"}
);
});

View File

@ -15,7 +15,7 @@ program
console.log("");
return;
}
var file = Helper.HOME + "/users/" + name + "/user.json";
var file = Helper.HOME + "/users/" + name + ".json";
var user = require(file);
require("read")({
prompt: "Password: ",