Build a binary to the /dist directory using the node module 'pkg'. Create a new directory for the platform and architecture of the host machine building the file.
This commit is contained in:
parent
f34b1810de
commit
4aef3459ba
|
@ -0,0 +1,21 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const { exec } = require('pkg')
|
||||||
|
const os = require('os')
|
||||||
|
const fs = require('fs-extra')
|
||||||
|
|
||||||
|
const platform = os.platform()
|
||||||
|
const arch = os.arch()
|
||||||
|
|
||||||
|
//exec(args) takes an array of command line arguments and returns a promise. For example:
|
||||||
|
|
||||||
|
if (!fs.existsSync(`./dist/${platform}_${arch}`)) {
|
||||||
|
fs.mkdirSync(`./dist/${platform}_${arch}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
exec([ 'frameloom', '--target', 'host', '--output', `./dist/${platform}_${arch}/frameloom` ]).then(res => {
|
||||||
|
console.log('built')
|
||||||
|
}).catch(err => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
// do something with app.exe, run, test, upload, deploy, etc
|
Loading…
Reference in New Issue