@@ -26,7 +26,30 @@ function verifyIsCleanWorkTree() {
26
26
}
27
27
28
28
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
+ } )
30
53
}
31
54
32
55
clean ( )
@@ -51,11 +74,12 @@ var tmpdir_config = {
51
74
encoding : 'utf8' , stdio : 'inherit'
52
75
}
53
76
console . log ( `start installing` )
77
+ // @ts -ignore
54
78
p . execSync ( `npm install` , tmpdir_config )
55
79
console . log ( `finish installing` )
56
80
clean ( )
57
81
verifyIsCleanWorkTree ( )
58
82
console . log ( `okay to publish` )
59
83
60
84
console . log ( `checking windows` )
61
- assert ( checkWinBinary )
85
+ checkWinBinary ( )
0 commit comments