forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprebuilt.js
29 lines (23 loc) · 779 Bytes
/
prebuilt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//@ts-check
var child_process = require('child_process')
var fs = require('fs')
var path = require('path')
var {sys_extension, is_windows} = require('./config.js')
var root = path.join(__dirname, '..')
var root_config = { cwd: root, stdio: [0, 1, 2] }
process.env.BS_RELEASE_BUILD = 'true'
function buildCompiler() {
child_process.execSync('make -j1 -B -C lib all', root_config)
fs.readdirSync(path.join(root, 'lib')).forEach(function (f) {
var last_index = f.lastIndexOf('.exe')
if (last_index !== -1) {
var new_file = f.slice(0, -4) + sys_extension
console.log(f + " --> " + new_file)
fs.renameSync(path.join(root, 'lib', f), path.join(root, 'lib', new_file))
}
})
}
if(!is_windows){
require('./runtimeDeps.js').updateAllLibsNinja()
}
buildCompiler()