improve upgrade process

This commit is contained in:
josc146
2023-05-24 23:05:19 +08:00
parent 9f080b63e0
commit 5192e31bac
3 changed files with 20 additions and 5 deletions

View File

@@ -188,6 +188,16 @@ export function forceDownloadProgramFiles() {
});
}
export async function deleteDynamicProgramFiles() {
let promises: Promise<void>[] = [];
manifest.programFiles.forEach(({ path }) => {
if ((path.endsWith('.py') && !path.includes('get-pip.py')) || path.includes('requirements') || path.endsWith('.pyd'))
promises.push(DeleteFile(path));
});
return await Promise.allSettled(promises).catch(() => {
});
}
export function bytesToGb(size: number) {
return (size / 1024 / 1024 / 1024).toFixed(2);
}