1- #!/usr/bin/env node
1+ #!/usr/bin/env node --expose-gc
22
33'use strict'
44
@@ -7,6 +7,7 @@ const path = require('path')
77const semver = require ( 'semver' )
88const ethUtil = require ( 'ethereumjs-util' )
99const swarmhash = require ( 'swarmhash' )
10+ const solc = require ( 'solc/wrapper' )
1011
1112// This script updates the index files list.js and list.txt in the bin directory,
1213// as well as the soljson-latest.js files.
@@ -30,6 +31,15 @@ fs.readdir(path.join(__dirname, '/bin'), function (err, files) {
3031 function readFile ( file ) {
3132 return fs . readFileSync ( path . join ( __dirname , '/bin' , file ) )
3233 }
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+ }
3343
3444 // ascending list (oldest version first)
3545 const parsedList = files
@@ -39,6 +49,7 @@ fs.readdir(path.join(__dirname, '/bin'), function (err, files) {
3949 . map ( function ( pars ) {
4050 const fileContent = readFile ( pars . path )
4151 pars . longVersion = buildVersion ( pars )
52+ pars . reportedVersion = readBuiltinVersion ( pars . path )
4253 pars . keccak256 = '0x' + ethUtil . sha3 ( fileContent ) . toString ( 'hex' )
4354 pars . urls = [ 'bzzr://' + swarmhash ( fileContent ) . toString ( 'hex' ) ]
4455 return pars
0 commit comments