diff --git a/lib/server/validate.js b/lib/server/validate.js index 526ed793..0fba6f93 100644 --- a/lib/server/validate.js +++ b/lib/server/validate.js @@ -1,31 +1,29 @@ -(function() { - 'use strict'; +'use strict'; + +var DIR = './'; +var exit = require(DIR + 'exit'); + +module.exports.root = root; +module.exports.editor = editor; + +function root(dir) { + var fs; - var DIR = './', - exit = require(DIR + 'exit'); - - module.exports.root = root; - module.exports.editor = editor; - - function root(dir) { - var fs; - - if (dir !== '/') { - fs = require('fs'); - fs.stat(dir, function(error) { - if (error) - exit('cloudcmd --root: %s', error.message); - else - console.log('root:', dir); - }); - } + if (dir !== '/') { + fs = require('fs'); + fs.stat(dir, function(error) { + if (error) + exit('cloudcmd --root: %s', error.message); + else + console.log('root:', dir); + }); } +} + +function editor(name) { + var reg = /^(dword|edward|deepword)$/; - function editor(name) { - var reg = /^(dword|edward|deepword)$/; - - if (!reg.test(name)) - exit('cloudcmd --editor: could be "dword", "edward" or "deepword" only'); - } - -})(); + if (!reg.test(name)) + exit('cloudcmd --editor: could be "dword", "edward" or "deepword" only'); +} +