Delete existing archives

This commit is contained in:
Sam Carlton 2022-07-18 21:22:48 -05:00
parent 383a4b2730
commit 4b73486688

View file

@ -5,6 +5,7 @@ import {
expect
} from 'vitest'
import fs from 'fs-extra'
import path from 'node:path'
// https://github.com/mrmlnc/fast-glob
import glob from 'fast-glob'
@ -41,6 +42,12 @@ const plainAppBundles = glob
async function makeZipFromBundlePath ( bundlePath ) {
const archivePath = `${ tempPath }/${ bundlePath.split('/').pop() }.zip`
// Delete any existing archive
if ( await fs.exists( archivePath ) ) {
console.log( 'Deleting existing archive', archivePath )
await fs.unlink( archivePath )
}
// console.log( 'archivePath', archivePath )
const zipLib = new Zip()