Улучшение отдачи файлов книг и статики

This commit is contained in:
Book Pauk
2022-10-20 21:46:05 +07:00
parent f7297ac573
commit 8c1ec1dc93
3 changed files with 52 additions and 45 deletions

View File

@@ -13,15 +13,6 @@ module.exports = async(config) => {
return;
}
//сохраним files
const filesDir = `${config.publicDir}/files`;
let tmpFilesDir = '';
if (await fs.pathExists(filesDir)) {
tmpFilesDir = `${config.dataDir}/files`;
if (!await fs.pathExists(tmpFilesDir))
await fs.move(filesDir, tmpFilesDir);
}
await fs.remove(config.publicDir);
//извлекаем новый webApp
@@ -35,10 +26,6 @@ module.exports = async(config) => {
await zipReader.close();
}
//восстановим files
if (tmpFilesDir)
await fs.move(tmpFilesDir, filesDir);
await fs.writeFile(verFile, config.version);
await fs.remove(zipFile);
};