Lots of updates :o

This commit is contained in:
2022-06-14 20:50:51 +02:00
parent e0d4f8747e
commit a9a8609cb8
25 changed files with 11575 additions and 675 deletions

27
tasks/bundle.ts Normal file
View File

@ -0,0 +1,27 @@
const fs = require('fs')
const path = require('path')
const yazl = require('yazl')
function walkDirectory(dir, callback) {
for (const file of fs.readdirSync(dir)) {
const filePath = path.join(dir, file)
fs.statSync(filePath).isDirectory() ? walkDirectory(filePath, callback) : callback(filePath)
}
}
async function bundle_zip() {
const zipfile = new yazl.ZipFile()
walkDirectory('build', (path) => {
zipfile.addFile(path, path.substring(6))
})
zipfile.end()
fs.mkdirSync('dist', {recursive: true})
zipfile.outputStream.pipe(fs.createWriteStream(`dist/stream_bypass-v${process.env.npm_package_version}.zip`))
}
async function bundle() {
await bundle_zip()
}
bundle()