cli: code cleanup

This commit is contained in:
Thomas Hobson 2021-03-05 19:40:47 +13:00
parent e57e56037c
commit d1b41e3c2f
No known key found for this signature in database
GPG key ID: 9F1FD9D87950DB6F
3 changed files with 19 additions and 14 deletions

View file

@ -17,11 +17,13 @@ exports.handler = async function(argv){
const api = new PistonEngine(argv['piston-url']);
const repos = await api.list_repos();
const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug)));
const repo_pkgs = await Promise.all(repos_obj.map(
async repo => ({
repo: repo,
packages: await repo.list_packages().catch(x=>[])
packages: await repo.list_packages().catch(_=>[])
})
))