File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { downloadFile } from "./utils/download";
77import path from "path" ;
88import { TEMP_DIR } from "./utils/env" ;
99import { GIT_SHORT_HASH } from "./utils/shell" ;
10+ import { existsSync } from "fs" ;
11+ import { mkdirp } from "fs-extra" ;
1012
1113const nightlyBuild = process . argv . includes ( "--nightly" ) ;
1214
@@ -76,14 +78,25 @@ const isValidFormat = (fileName: string): boolean => {
7678 }
7779 } ) ;
7880
79- await Promise . all ( downloadTasks ) ;
81+ try {
82+ mkdirp ( TEMP_DIR ) ;
83+
84+ await Promise . all ( downloadTasks ) ;
85+ } catch ( error ) {
86+ consola . error ( error ) ;
87+ throw new Error ( "Error during download or upload tasks" ) ;
88+ }
89+
90+ reourceMappping . forEach ( ( item ) => {
91+ consola . log ( `exited ${ item } :` , existsSync ( item ) ) ;
92+ } ) ;
8093
8194 consola . start ( "Staring upload tasks (nightly)" ) ;
8295
8396 await client . sendFile ( TELEGRAM_TO_NIGHTLY , {
8497 file : reourceMappping ,
8598 forceDocument : true ,
86- caption : `Clash Nyanpasu Nighly Build ${ GIT_SHORT_HASH } ` ,
99+ caption : `Clash Nyanpasu Nightly Build ${ GIT_SHORT_HASH } ` ,
87100 } ) ;
88101
89102 consola . success ( "Upload finished (nightly)" ) ;
You can’t perform that action at this time.
0 commit comments