mirror of
https://github.com/enso-org/enso.git
synced 2024-11-26 17:06:48 +03:00
044ec6f918
Original commit: 9e1ad61ec6
38 lines
1018 B
JavaScript
Executable File
38 lines
1018 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const cmd = require('./build/cmd')
|
|
const fs = require('fs').promises
|
|
const fss = require('fs')
|
|
const paths = require('./build/paths')
|
|
|
|
process.on('unhandledRejection', error => { throw(error) })
|
|
|
|
let args = process.argv.slice(2)
|
|
|
|
let no_validation = '--no-validation'
|
|
async function init () {
|
|
if(!args.includes(no_validation)) {
|
|
await cmd.check_version('node','v12.18.4',{silent:true})
|
|
await cmd.check_version('npm','6.14.6',{silent:true})
|
|
await cmd.check_version('rustc','1.40.0-nightly',{
|
|
preprocess:(v)=>v.substring(6,20),silent:true
|
|
})
|
|
}
|
|
|
|
let initialized = fss.existsSync(paths.dist.init)
|
|
if (!initialized) {
|
|
cmd.section('Initialization')
|
|
console.log('Installing build script dependencies.')
|
|
await cmd.with_cwd('build', async () => {
|
|
await cmd.run('npm',['install'])
|
|
})
|
|
}
|
|
}
|
|
|
|
async function main() {
|
|
await init()
|
|
cmd.run('node',[paths.script.run].concat(args))
|
|
}
|
|
|
|
main()
|