mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 05:31:03 +00:00
Update shoutcut.js
This commit is contained in:
parent
0cd8f24182
commit
72d8e8bcb0
23
shoutcut.js
23
shoutcut.js
|
@ -7,13 +7,20 @@ exports.main = function(args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var FN = args[0];
|
var FN = args[0];
|
||||||
var target = require(FN);
|
var target = require(FN);
|
||||||
|
|
||||||
if ("onShoutcut" in target) {
|
if ("onShoutcut" in target) {
|
||||||
console.log("Trying execute onShoutcut:", FN);
|
console.log("Trying execute onShoutcut:", FN);
|
||||||
target.onShoutcut(args.slice(1));
|
while (true) {
|
||||||
} else {
|
try {
|
||||||
console.error("onShoutcut not defined");
|
target.onShoutcut(args.slice(1));
|
||||||
}
|
} catch (e) {
|
||||||
|
console.error("onShoutcut ->", e.message);
|
||||||
|
target.onShoutcut(args.slice(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.error("onShoutcut not defined");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user