17 lines
494 B
JavaScript
17 lines
494 B
JavaScript
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
|
|
})
|