File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var path = require ( 'path' ) ;
4
+
5
+ var github = require ( '../_common/github.js' ) ;
6
+ var owner = 'eugeneware' ;
7
+ var repo = 'ffmpeg-static' ;
8
+
9
+ module . exports = function ( request ) {
10
+ return github ( request , owner , repo ) . then ( function ( all ) {
11
+ all . releases = all . releases
12
+ . filter ( function ( rel ) {
13
+ let isFfmpeg = rel . name . includes ( 'ffmpeg' ) ;
14
+ if ( ! isFfmpeg ) {
15
+ return ;
16
+ }
17
+
18
+ // remove README and LICENSE
19
+ return ! [ '.README' , '.LICENSE' ] . includes ( path . extname ( rel . name ) ) ;
20
+ } )
21
+ . map ( function ( rel ) {
22
+ rel . version = rel . version . replace ( / ^ b / , '' ) ;
23
+
24
+ if ( / w i n 3 2 / . test ( rel . name ) ) {
25
+ rel . os = 'windows' ;
26
+ rel . ext = 'exe' ;
27
+ }
28
+ if ( / i a 3 2 / . test ( rel . name ) ) {
29
+ rel . arch = '386' ;
30
+ } else if ( / x 6 4 / . test ( rel . name ) ) {
31
+ rel . arch = 'amd64' ;
32
+ }
33
+
34
+ return rel ;
35
+ } ) ;
36
+ return all ;
37
+ } ) ;
38
+ } ;
39
+
40
+ if ( module === require . main ) {
41
+ module . exports ( require ( '@root/request' ) ) . then ( function ( all ) {
42
+ all = require ( '../_webi/normalize.js' ) ( all ) ;
43
+ console . info ( JSON . stringify ( all ) ) ;
44
+ } ) ;
45
+ }
You can’t perform that action at this time.
0 commit comments