feat: build licensed desktop image processor
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const fs = require('node:fs/promises')
|
||||
const path = require('node:path')
|
||||
const sharp = require('sharp')
|
||||
|
||||
async function main() {
|
||||
const source = path.resolve(__dirname, '../build/icon.svg')
|
||||
const output = path.resolve(__dirname, '../build/icon.png')
|
||||
await fs.mkdir(path.dirname(output), { recursive: true })
|
||||
await sharp(source).resize(512, 512).png().toFile(output)
|
||||
process.stdout.write(`icon=${output}\n`)
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error)
|
||||
process.exitCode = 1
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
|
||||
// 编译前只清理可再生的 Electron 输出,避免旧测试产物被误打进安装包。
|
||||
fs.rmSync(path.resolve(__dirname, '../dist-electron'), { recursive: true, force: true })
|
||||
Reference in New Issue
Block a user