File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
ci/cloudfunctions/getVizzuList Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,22 @@ exports.getVizzuList = (req, res) => {
77 const bucket = storage . bucket ( bucketName ) ;
88 bucket . getFiles ( ) . then ( files => {
99 let ans = [ ] ;
10+ files [ 0 ] . sort ( ( a , b ) => {
11+ if ( a . metadata . updated > b . metadata . updated ) {
12+ return 1 ;
13+ }
14+ if ( a . metadata . updated < b . metadata . updated ) {
15+ return - 1 ;
16+ }
17+ return 0 ;
18+ } ) ;
1019 files [ 0 ] . forEach ( file => {
1120 let fileEnd = '/vizzu.js'
1221 if ( file . name . endsWith ( fileEnd ) ) {
13- ans . push ( file . name . slice ( 0 , - fileEnd . length ) ) ;
22+ let tmp = { } ;
23+ tmp . sha = file . name . slice ( 0 , - fileEnd . length )
24+ tmp . time = file . metadata . updated ;
25+ ans . push ( tmp ) ;
1426 }
1527 } ) ;
1628 let message = req . query . message || req . body . message || JSON . stringify ( ans ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " getVizzuList" ,
3- "version" : " 0.0.1 " ,
3+ "version" : " 0.0.2 " ,
44 "dependencies" : {
55 "@google-cloud/storage" : " *" ,
66 "@google-cloud/functions-framework" : " *"
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ class Manual {
3838 libList [ 'HEAD' ] = 'https://' + remoteStableBucket + '/lib' ;
3939 let vizzuListUrl = await fetch ( 'https://' + remoteCloudFunctions + '/getVizzuList' ) ;
4040 let vizzuList = await vizzuListUrl . json ( ) ;
41- vizzuList . forEach ( vizzu => {
42- libList [ vizzu ] = 'https://' + remoteLatestBucket + '/' + vizzu ;
41+ vizzuList . slice ( ) . reverse ( ) . forEach ( vizzu => {
42+ libList [ vizzu . time . substring ( 0 , 10 ) + ' ' + vizzu . time . substring ( 11 , 16 ) + ' ' + vizzu . sha ] = 'https://' + remoteLatestBucket + '/' + vizzu . sha ;
4343 } ) ;
4444 libList [ '0.2.0' ] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0' ;
4545 this . #server. get ( '/getLibList' , ( req , res ) => {
You can’t perform that action at this time.
0 commit comments