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() {
4141function runScripts ( scriptIds , event , path ) {
4242 for ( let id of scriptIds . filter ( ( _ ) => _ ) ) {
4343 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 ) ;
5357 }
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+ } ) ;
5862 }
5963}
6064
You can’t perform that action at this time.
0 commit comments