🐛 Handle non-existing 'dist' & 'build' directories, replace deprecated method call

This commit is contained in:
KaKi87 2022-08-07 18:19:36 +02:00
parent 864bfa2a2c
commit a82fdc074d
1 changed files with 2 additions and 2 deletions

View File

@ -5,8 +5,8 @@ import electronBuilder from 'electron-builder';
process.env['PARCEL_WORKER_BACKEND'] = 'process';
(async () => {
fs.rmdirSync('./dist', { recursive: true });
fs.rmdirSync('./build', { recursive: true });
try { fs.rmSync('./dist', { recursive: true }); } catch {}
try { fs.rmSync('./build', { recursive: true }); } catch {}
const packageFileLines = fs.readFileSync('./package.json', 'utf8').split('\n');
fs.writeFileSync('./package.json', [...packageFileLines.slice(0, 2), ...packageFileLines.slice(4)].join('\n'));
await new Parcel({