File tree 2 files changed +51
-5
lines changed
2 files changed +51
-5
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
var cp = require ( 'child_process' )
3
3
var fs = require ( 'fs' )
4
+ exports . run = function ( ) {
5
+ cp . execSync ( `make clean` )
6
+ if ( fs . existsSync ( `stdlib-406` ) ) {
7
+ cp . execSync ( `git clean -dfx stdlib-406` )
8
+ }
4
9
5
- cp . execSync ( `make clean` )
6
- if ( fs . existsSync ( `stdlib-406` ) ) {
7
- cp . execSync ( `git clean -dfx stdlib-406` )
10
+ cp . execSync ( `git clean -dfx stdlib-402 test others runtime` )
8
11
}
9
12
10
- cp . execSync ( `git clean -dfx stdlib-402 test others runtime` )
11
-
13
+ if ( require . main === module ) {
14
+ run ( )
15
+ }
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ var fs = require ( 'fs' )
3
+ var path = require ( 'path' )
4
+
5
+
6
+ var clean = require ( './cleanlib.js' )
7
+ function toggleMakefile ( ) {
8
+ var filename = path . join ( __dirname , 'Makefile.shared' )
9
+ var line = fs . readFileSync ( filename , 'utf8' )
10
+ var toggled = ( line . split ( '\n' ) . map ( x => {
11
+ if ( x . startsWith ( 'STDLIB' ) ) {
12
+ return '# ' + x
13
+ } else if ( x . startsWith ( '# STDLIB' ) ) {
14
+ return x . substring ( 2 )
15
+ }
16
+ return x
17
+ } ) . join ( '\n' ) )
18
+
19
+ fs . writeFileSync ( filename , toggled , 'utf8' )
20
+ }
21
+ function toggleSharedMakefile ( ) {
22
+ var filename = path . join ( __dirname , 'test' , 'Makefile' )
23
+ var line = fs . readFileSync ( filename , 'utf8' )
24
+ var toggled = ( line . split ( '\n' ) . map ( x => {
25
+ if ( x . startsWith ( ' # ocaml_typedtree_test' ) ) {
26
+ return ' ocaml_typedtree_test'
27
+ } else {
28
+ if ( x . startsWith ( ' ocaml_typedtree_test' ) ) {
29
+ return ' # ocaml_typedtree_test'
30
+ }
31
+ }
32
+ return x
33
+ } ) ) . join ( '\n' )
34
+ fs . writeFileSync ( filename , toggled , 'utf8' )
35
+ }
36
+
37
+
38
+ toggleMakefile ( )
39
+ toggleSharedMakefile ( )
40
+ clean . run ( )
41
+
42
+
You can’t perform that action at this time.
0 commit comments