fix(build): avoid mirror oisd outside of gitlab pages
This commit is contained in:
parent
67cd8b860c
commit
add4913170
|
@ -5,7 +5,7 @@
|
|||
const { stream: gotStream } = require('got')
|
||||
const unzip = require('extract-zip')
|
||||
const { join } = require('path')
|
||||
const { mkdir } = require('fs/promises')
|
||||
const { mkdir, readdir, rm } = require('fs/promises')
|
||||
const { createWriteStream } = require('fs')
|
||||
const { pipeline } = require('stream/promises')
|
||||
|
||||
|
@ -13,6 +13,7 @@ const rootPath = join(__dirname, '..')
|
|||
const tmpPath = join(rootPath, 'tmp')
|
||||
const zipPath = join(tmpPath, 'artifacts.zip')
|
||||
const artifactsUrl = 'https://gitlab.com/curben/malware-filter/-/jobs/artifacts/main/download?job=pages'
|
||||
const publicPath = join(rootPath, 'public')
|
||||
|
||||
const f = async () => {
|
||||
await mkdir(tmpPath, { recursive: true })
|
||||
|
@ -25,6 +26,11 @@ const f = async () => {
|
|||
|
||||
console.log('Extracting artifacts.zip...')
|
||||
await unzip(zipPath, { dir: rootPath })
|
||||
|
||||
const files = await readdir(publicPath)
|
||||
for (const file of files) {
|
||||
if (file.startsWith('oisd')) await rm(join(publicPath, file))
|
||||
}
|
||||
}
|
||||
|
||||
f()
|
||||
|
|
Loading…
Reference in New Issue