📦 Chore(custom): add a new build action

This commit is contained in:
Kuingsmile
2026-01-15 16:14:10 +08:00
parent 0fac820d31
commit 796fb9847d
3 changed files with 245 additions and 2 deletions

View File

@@ -1,7 +1,9 @@
const fs = require('node:fs')
const path = require('node:path')
async function main(context) {
const localeDir = context.appOutDir + '/locales/'
const { appOutDir, targets } = context
const localeDir = appOutDir + '/locales/'
fs.readdir(localeDir, function (_err, files) {
if (!(files && files.length)) return
@@ -11,6 +13,16 @@ async function main(context) {
}
}
})
const isZip = targets.some(target => target.name === 'zip')
if (isZip) {
const portablePath = path.join(appOutDir, 'PORTABLE')
try {
fs.writeFileSync(portablePath, '')
console.log('Created portable marker file at', portablePath)
} catch (err) {
console.error('Error creating portable marker file:', err)
}
}
}
exports.default = main