-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
|
||
var github = require('../_common/github.js'); | ||
var owner = 'eugeneware'; | ||
var repo = 'ffmpeg-static'; | ||
|
||
module.exports = function (request) { | ||
return github(request, owner, repo).then(function (all) { | ||
all.releases = all.releases | ||
.filter(function (rel) { | ||
let isFfmpeg = rel.name.includes('ffmpeg'); | ||
if (!isFfmpeg) { | ||
return; | ||
} | ||
|
||
// remove README and LICENSE | ||
return !['.README', '.LICENSE'].includes(path.extname(rel.name)); | ||
}) | ||
.map(function (rel) { | ||
rel.version = rel.version.replace(/^b/, ''); | ||
|
||
if (/win32/.test(rel.name)) { | ||
rel.os = 'windows'; | ||
rel.ext = 'exe'; | ||
} | ||
if (/ia32/.test(rel.name)) { | ||
rel.arch = '386'; | ||
} else if (/x64/.test(rel.name)) { | ||
rel.arch = 'amd64'; | ||
} | ||
|
||
return rel; | ||
}); | ||
return all; | ||
}); | ||
}; | ||
|
||
if (module === require.main) { | ||
module.exports(require('@root/request')).then(function (all) { | ||
all = require('../_webi/normalize.js')(all); | ||
console.info(JSON.stringify(all)); | ||
}); | ||
} |