diff --git a/package.json b/package.json index 997157ef..44786734 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.14.1", + "version": "0.14.2", "author": "Mattias Erming", "preferGlobal": true, "bin": { diff --git a/src/command-line/add.js b/src/command-line/add.js index 8b471e19..58d0a9d7 100644 --- a/src/command-line/add.js +++ b/src/command-line/add.js @@ -1,6 +1,7 @@ var ClientManager = new require("../clientManager"); var fs = require("fs"); var program = require("commander"); +var mkdirp = require("mkdirp"); const HOME = process.env.HOME + "/.shout"; @@ -8,6 +9,16 @@ program .command("add ") .description("Add a new user") .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 { var path = HOME + "/users"; var test = path + "/.test";