mirror of
https://github.com/NohamR/oled-nnw.git
synced 2026-05-25 04:17:19 +00:00
chore(script): build script
This commit is contained in:
23
scripts/build.ts
Normal file
23
scripts/build.ts
Normal file
@@ -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