File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 59
59
},
60
60
"devDependencies" : {
61
61
"@types/node" : " ^16.11.7" ,
62
+ "@types/tmp" : " ^0.2.3" ,
62
63
"@types/semver" : " ^7.3.9" ,
63
64
"@types/tape" : " ^4.13.2" ,
64
65
"@typescript-eslint/eslint-plugin" : " ^5.8.0" ,
Original file line number Diff line number Diff line change 1
1
import assert from 'assert' ;
2
2
import tape from 'tape' ;
3
3
import * as semver from 'semver' ;
4
+ import * as tmp from 'tmp' ;
4
5
import solc from '../' ;
5
6
import linker from '../linker' ;
6
7
import { execSync } from 'child_process' ;
@@ -888,8 +889,10 @@ if (!noRemoteVersions) {
888
889
] ;
889
890
for ( let version in versions ) {
890
891
version = versions [ version ] ;
891
- execSync ( `curl -L -o /tmp/${ version } .js https://binaries.soliditylang.org/bin/soljson-${ version } .js` ) ;
892
- const newSolc = wrapper ( require ( `/tmp/${ version } .js` ) ) ;
892
+ // NOTE: The temporary directory will be removed on process exit.
893
+ const tempDir = tmp . dirSync ( { unsafeCleanup : true , prefix : 'solc-js-compiler-test-' } ) . name ;
894
+ execSync ( `curl -L -o ${ tempDir } /${ version } .js https://binaries.soliditylang.org/bin/soljson-${ version } .js` ) ;
895
+ const newSolc = wrapper ( require ( `${ tempDir } /${ version } .js` ) ) ;
893
896
runTests ( newSolc , version ) ;
894
897
}
895
898
}
You can’t perform that action at this time.
0 commit comments