1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node --expose-gc
2
2
3
3
'use strict'
4
4
@@ -7,6 +7,7 @@ const path = require('path')
7
7
const semver = require ( 'semver' )
8
8
const ethUtil = require ( 'ethereumjs-util' )
9
9
const swarmhash = require ( 'swarmhash' )
10
+ const solc = require ( 'solc/wrapper' )
10
11
11
12
// This script updates the index files list.js and list.txt in the bin directory,
12
13
// as well as the soljson-latest.js files.
@@ -30,6 +31,15 @@ fs.readdir(path.join(__dirname, '/bin'), function (err, files) {
30
31
function readFile ( file ) {
31
32
return fs . readFileSync ( path . join ( __dirname , '/bin' , file ) )
32
33
}
34
+
35
+ function readBuiltinVersion ( file ) {
36
+ var a = solc ( require ( path . join ( __dirname , '/bin' , file ) ) )
37
+ var b = a . version ( )
38
+ a = undefined
39
+ global . gc ( )
40
+ console . log ( b )
41
+ return b
42
+ }
33
43
34
44
// ascending list (oldest version first)
35
45
const parsedList = files
@@ -39,6 +49,7 @@ fs.readdir(path.join(__dirname, '/bin'), function (err, files) {
39
49
. map ( function ( pars ) {
40
50
const fileContent = readFile ( pars . path )
41
51
pars . longVersion = buildVersion ( pars )
52
+ pars . reportedVersion = readBuiltinVersion ( pars . path )
42
53
pars . keccak256 = '0x' + ethUtil . sha3 ( fileContent ) . toString ( 'hex' )
43
54
pars . urls = [ 'bzzr://' + swarmhash ( fileContent ) . toString ( 'hex' ) ]
44
55
return pars
0 commit comments