File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,24 @@ function getCurrentScriptSrc() {
41
41
function runScripts ( scriptIds , event , path ) {
42
42
for ( let id of scriptIds . filter ( ( _ ) => _ ) ) {
43
43
let scriptPath = `${ path } /${ id } .js` ;
44
- import ( scriptPath ) . then ( ( { default : script } ) => {
45
- try {
46
- if (
47
- event in script &&
48
- typeof script [ event ] === "function" &&
49
- checkWillRun ( script )
50
- ) {
51
- console . log ( "> Useful-script: Run script " + id + " " + event ) ;
52
- script [ event ] ( ) ;
44
+ import ( scriptPath )
45
+ . then ( ( { default : script } ) => {
46
+ try {
47
+ if (
48
+ event in script &&
49
+ typeof script [ event ] === "function" &&
50
+ checkWillRun ( script )
51
+ ) {
52
+ console . log ( "> Useful-script: Run script " + id + " " + event ) ;
53
+ script [ event ] ( ) ;
54
+ }
55
+ } catch ( e ) {
56
+ console . log ( "ERROR run script " + id + " " + event , e ) ;
53
57
}
54
- } catch ( e ) {
55
- console . log ( "ERROR run script " + id + " " + event , e ) ;
56
- }
57
- } ) ;
58
+ } )
59
+ . catch ( ( e ) => {
60
+ console . log ( "ERROR import script " , e ) ;
61
+ } ) ;
58
62
}
59
63
}
60
64
You can’t perform that action at this time.
0 commit comments