mirror of
https://github.com/NohamR/oled-nnw.git
synced 2026-11-25 23:07:51 +00:00
chore(script): build script
This commit is contained in:
1 parent
d35395d237
commit
349af148c4
1 file changed
+23
@@ -0,0 +1,23 @@
|
|||||||
|
import path from 'node:path'
|
||||||
|
import { rimrafSync } from 'rimraf'
|
||||||
|
import { mkdirp } from 'mkdirp'
|
||||||
|
import compressing from 'compressing'
|
||||||
|
import { consola } from 'consola'
|
||||||
|
|
||||||
|
async function build() {
|
||||||
|
try {
|
||||||
|
const FILE_NAME = 'Elegant.nnwtheme'
|
||||||
|
const targetDir = path.join(__dirname, '../', 'dist')
|
||||||
|
const target = path.join(targetDir, FILE_NAME)
|
||||||
|
const source = path.join(__dirname, '../', FILE_NAME)
|
||||||
|
rimrafSync(targetDir)
|
||||||
|
mkdirp.sync(targetDir)
|
||||||
|
await compressing.zip.compressDir(source, `${target}.zip`)
|
||||||
|
await compressing.tar.compressDir(source, `${target}.tar`)
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
consola.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build()
|
||||||
Reference in new issue
Block a user