@@ -120,17 +120,26 @@ const releasePairs = R.toPairs({
120120
121121const distributionPairs = [ ...debugPairs , ...releasePairs ] ;
122122
123+ const getDistributionConfigURLFromHash = itemHash =>
124+ `https://bintray.com/conan-community/conan/download_file?file_path=conan%2FOpenSSL%2F1.1.0i%2Fstable%2Fpackage%2F${ itemHash } %2Fconaninfo.txt`
125+
126+ const getDistributionDownloadURLFromHash = itemHash =>
127+ `https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/${ itemHash } /conan_package.tgz`
128+
129+ const getDistributionsRootURL = ( ) =>
130+ 'https://bintray.com/package/files/conan-community/conan/OpenSSL%3Aconan?order=asc&sort=name&basePath=conan%2FOpenSSL%2F1.1.0i%2Fstable%2Fpackage&tab=files'
131+
123132const detectDistributionPairFromConfig = ( itemHash , body ) => R . reduce (
124133 ( acc , [ releaseName , predicate ] ) => R . cond ( [
125- [ predicate , R . always ( [ releaseName , itemHash ] ) ] ,
134+ [ predicate , R . always ( [ releaseName , getDistributionDownloadURLFromHash ( itemHash ) ] ) ] ,
126135 [ R . T , R . always ( acc ) ]
127136 ] ) ( body ) ,
128137 undefined ,
129138 distributionPairs
130139) ;
131140
132141const getDistributionConfig = ( itemHash ) =>
133- request . get ( `https://bintray.com/conan-community/conan/download_file?file_path=conan%2FOpenSSL%2F1.1.0i%2Fstable%2Fpackage%2F ${ itemHash } %2Fconaninfo.txt` )
142+ request . get ( getDistributionConfigURLFromHash ( itemHash ) )
134143 . then ( ( body ) => detectDistributionPairFromConfig ( itemHash , body ) ) ;
135144
136145const discoverDistributions = ( treeHtml ) => {
@@ -151,9 +160,10 @@ const discoverDistributions = (treeHtml) => {
151160 ) ;
152161}
153162
154- request ( 'https://bintray.com/package/files/conan-community/conan/OpenSSL%3Aconan?order=asc&sort=name&basePath=conan%2FOpenSSL%2F1.1.0i%2Fstable%2Fpackage&tab=files' )
163+ const outputPath = path . resolve ( '..' , 'vendor' , 'openssl_distributions.json' ) ;
164+ request ( getDistributionsRootURL ( ) )
155165 . then ( discoverDistributions )
156166 . then ( R . filter ( R . identity ) )
157167 . then ( R . sortBy ( R . prop ( 0 ) ) )
158168 . then ( R . fromPairs )
159- . then ( distributions => fse . writeFile ( 'openssl_distributions.json' , JSON . stringify ( distributions , null , 2 ) ) ) ;
169+ . then ( distributions => fse . writeFile ( outputPath , JSON . stringify ( distributions , null , 2 ) ) ) ;
0 commit comments