Skip to content

Commit fbce42e

Browse files
committedDec 14, 2018
More sanity check
1 parent 8764b11 commit fbce42e

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"postinstall": "node scripts/install.js"
3333
},
3434
"name": "bs-platform",
35-
"version": "4.0.13",
35+
"version": "4.0.15",
3636
"description": "bucklescript compiler, ocaml standard libary by bucklescript and its required runtime support",
3737
"repository": {
3838
"type": "git",

‎scripts/prepublish.js

+26-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,30 @@ function verifyIsCleanWorkTree() {
2626
}
2727

2828
function checkWinBinary(){
29-
return fs.existsSync(path.join(root,'lib','bsc.win32'))
29+
var assocs = ['bsppx', 'bsb', 'bsb_helper', 'refmt', 'reactjs_jsx_ppx_2','bsc'].map(x=>{
30+
return [x, { win32 : false, darwin : false}]
31+
})
32+
// @ts-ignore
33+
var files = new Map( assocs )
34+
35+
// check sound
36+
var libDir = path.join(root,'lib')
37+
fs.readdirSync(libDir).forEach(x=>{
38+
var y = path.parse(x)
39+
if(y.ext === '.win32'){
40+
assert (files.has(y.name), `unknown ${x}`)
41+
files.get(y.name).win32 = true
42+
} else if(y.ext === '.darwin'){
43+
assert (files.has(y.name), `unknown ${x}`)
44+
files.get(y.name).darwin = true
45+
}
46+
})
47+
48+
// check complete
49+
files.forEach(x => {
50+
assert(x.win32, `${x}.win32 not available`)
51+
assert(x.darwin, `${x}.darwin not available`)
52+
} )
3053
}
3154

3255
clean()
@@ -51,11 +74,12 @@ var tmpdir_config = {
5174
encoding: 'utf8', stdio: 'inherit'
5275
}
5376
console.log(`start installing`)
77+
// @ts-ignore
5478
p.execSync(`npm install`, tmpdir_config)
5579
console.log(`finish installing`)
5680
clean()
5781
verifyIsCleanWorkTree()
5882
console.log(`okay to publish`)
5983

6084
console.log(`checking windows`)
61-
assert(checkWinBinary)
85+
checkWinBinary()

0 commit comments

Comments
 (0)
Please sign in to comment.