mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 05:22:10 +03:00
e10fc464a8
Original commit: c38ca0d5a4
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('npm','6.13.4',{silent:true})
|
|
await cmd.check_version('node','v12.16.1',{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()
|