mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
chore(validate) rm iife
This commit is contained in:
parent
5becf2c98c
commit
aad2e38603
1 changed files with 26 additions and 28 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue