2020-11-20 08:44:50 +00:00
|
|
|
var SHELL = require("lib/shell");
|
|
|
|
var SYS = require("lib/system");
|
2020-11-18 10:55:06 +00:00
|
|
|
|
|
|
|
exports.main = function(args) {
|
|
|
|
if (args.length < 1) {
|
2021-08-10 16:45:26 +00:00
|
|
|
console.error("arguments could not be empty")
|
2020-11-18 10:55:06 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-08-16 15:34:46 +00:00
|
|
|
var FN = args[0];
|
|
|
|
var target = require(FN);
|
2021-08-10 16:45:26 +00:00
|
|
|
|
2021-08-16 15:34:46 +00:00
|
|
|
if ("onShoutcut" in target) {
|
|
|
|
console.log("Trying execute onShoutcut:", FN);
|
|
|
|
while (true) {
|
|
|
|
try {
|
|
|
|
target.onShoutcut(args.slice(1));
|
|
|
|
} catch (e) {
|
|
|
|
console.error("onShoutcut ->", e.message);
|
|
|
|
target.onShoutcut(args.slice(1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
console.error("onShoutcut not defined");
|
|
|
|
}
|
2020-11-18 10:55:06 +00:00
|
|
|
};
|