diff --git a/src/command-line/add.js b/src/command-line/add.js index 7f335d8f..d4c47124 100644 --- a/src/command-line/add.js +++ b/src/command-line/add.js @@ -1,6 +1,5 @@ var ClientManager = new require("../clientManager"); var bcrypt = require("bcrypt-nodejs"); -var fs = require("fs"); var program = require("commander"); var mkdirp = require("mkdirp"); var Helper = require("../helper"); @@ -12,17 +11,6 @@ program try { mkdirp.sync(Helper.USERS_PATH); } catch (e) { - log.error("Could not create", Helper.USERS_PATH); - log.info("Try running the command as sudo."); - return; - } - try { - var test = require("path").join(Helper.USERS_PATH, ".test"); - fs.mkdirSync(test); - fs.rmdirSync(test); - } catch (e) { - log.error("You have no permissions to write to", Helper.USERS_PATH); - log.info("Try running the command as sudo."); log.error("Could not create", Helper.USERS_PATH); return; } diff --git a/src/command-line/remove.js b/src/command-line/remove.js index d6f383e6..0d3b2ce9 100644 --- a/src/command-line/remove.js +++ b/src/command-line/remove.js @@ -1,21 +1,10 @@ var ClientManager = new require("../clientManager"); -var fs = require("fs"); var program = require("commander"); -var Helper = require("../helper"); program .command("remove ") .description("Remove an existing user") .action(function(name) { - try { - var test = require("path").join(Helper.USERS_PATH, ".test"); - fs.mkdirSync(test); - fs.rmdirSync(test); - } catch (e) { - log.warn("You have no permissions to delete from " + Helper.USERS_PATH); - log.info("Try running the command as sudo."); - return; - } var manager = new ClientManager(); if (manager.removeUser(name)) { log.info("Removed user '" + name + "'.");