feat: clear rollup
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| import path from 'path'; | ||||
| import fs from 'fs'; | ||||
| import { storage } from '../query.ts'; | ||||
| import { chalk } from '../chalk.ts'; | ||||
|  | ||||
| type DownloadTask = { | ||||
|   downloadPath: string; | ||||
| @@ -69,8 +70,17 @@ export const installApp = async (app: Package, opts: InstallAppOpts = {}) => { | ||||
|       if (token) { | ||||
|         fetchURL.searchParams.set('token', token); | ||||
|       } | ||||
|       fetchURL.searchParams.set('download', 'true'); | ||||
|       const res = await fetch(fetchURL.toString()); | ||||
|       const blob = await res.blob(); | ||||
|       const type = blob.type; | ||||
|       if (type.includes('text/html')) { | ||||
|         const html = await blob.text(); | ||||
|         if (html === 'fetchRes is error') { | ||||
|           console.log(chalk.red('fetchRes is error')); | ||||
|           break; | ||||
|         } | ||||
|       } | ||||
|       fs.writeFileSync(downloadPath, Buffer.from(await blob.arrayBuffer())); | ||||
|     } | ||||
|     let indexHtml = files.find((file: any) => file.name === 'index.html'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user