Create 'users/' if not exist
This commit is contained in:
parent
2f5be12d00
commit
04da27617e
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "shout",
|
"name": "shout",
|
||||||
"description": "A web IRC client",
|
"description": "A web IRC client",
|
||||||
"version": "0.14.1",
|
"version": "0.14.2",
|
||||||
"author": "Mattias Erming",
|
"author": "Mattias Erming",
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
var ClientManager = new require("../clientManager");
|
var ClientManager = new require("../clientManager");
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
var program = require("commander");
|
var program = require("commander");
|
||||||
|
var mkdirp = require("mkdirp");
|
||||||
|
|
||||||
const HOME = process.env.HOME + "/.shout";
|
const HOME = process.env.HOME + "/.shout";
|
||||||
|
|
||||||
@ -8,6 +9,16 @@ program
|
|||||||
.command("add <name>")
|
.command("add <name>")
|
||||||
.description("Add a new user")
|
.description("Add a new user")
|
||||||
.action(function(name) {
|
.action(function(name) {
|
||||||
|
try {
|
||||||
|
var path = HOME + "/users";
|
||||||
|
mkdirp.sync(path);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("");
|
||||||
|
console.log("Could not create " + path);
|
||||||
|
console.log("Try running the command as sudo.");
|
||||||
|
console.log("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
var path = HOME + "/users";
|
var path = HOME + "/users";
|
||||||
var test = path + "/.test";
|
var test = path + "/.test";
|
||||||
|
Loading…
Reference in New Issue
Block a user