fix command-line scripts to work with username.json files
This commit is contained in:
parent
3fc80efd7c
commit
d18f318cad
@ -5,7 +5,7 @@ var Helper = require("../helper");
|
|||||||
|
|
||||||
program
|
program
|
||||||
.command("edit <name>")
|
.command("edit <name>")
|
||||||
.description("Edit user: '" + Helper.HOME + "/users/<name>/user.json'")
|
.description("Edit user: '" + Helper.HOME + "/users/<name>.json'")
|
||||||
.action(function(name) {
|
.action(function(name) {
|
||||||
var users = new ClientManager().getUsers();
|
var users = new ClientManager().getUsers();
|
||||||
if (users.indexOf(name) === -1) {
|
if (users.indexOf(name) === -1) {
|
||||||
@ -16,7 +16,7 @@ program
|
|||||||
}
|
}
|
||||||
child.spawn(
|
child.spawn(
|
||||||
process.env.EDITOR || "vi",
|
process.env.EDITOR || "vi",
|
||||||
[require("path").join(Helper.HOME, "users", name, "user.json")],
|
[require("path").join(Helper.HOME, "users", name + ".json")],
|
||||||
{stdio: "inherit"}
|
{stdio: "inherit"}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,7 @@ program
|
|||||||
console.log("");
|
console.log("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var file = Helper.HOME + "/users/" + name + "/user.json";
|
var file = Helper.HOME + "/users/" + name + ".json";
|
||||||
var user = require(file);
|
var user = require(file);
|
||||||
require("read")({
|
require("read")({
|
||||||
prompt: "Password: ",
|
prompt: "Password: ",
|
||||||
|
Loading…
Reference in New Issue
Block a user