mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(tryRequire) options: add callback
This commit is contained in:
parent
cff157d7f1
commit
9a3f87fcff
1 changed files with 9 additions and 2 deletions
|
|
@ -11,9 +11,16 @@
|
|||
module = require(name);
|
||||
});
|
||||
|
||||
if (error && o.log)
|
||||
Util.log(error.message);
|
||||
if (error)
|
||||
if (o.log)
|
||||
Util.log(error.message);
|
||||
else if (o.callback)
|
||||
module = exec.bind(null, error);
|
||||
|
||||
return module;
|
||||
};
|
||||
|
||||
function exec(error, callback) {
|
||||
callback(error);
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue