mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-23 13:36:31 +02:00
Piston lint
This commit is contained in:
parent
d61fb8ec5b
commit
f2c91acbe6
57 changed files with 1121 additions and 893 deletions
|
@ -5,17 +5,21 @@ exports.aliases = ['l'];
|
|||
exports.describe = 'Lists all available packages';
|
||||
|
||||
const msg_format = {
|
||||
color: p => `${chalk[p.installed ? 'green':'red']('•')} ${p.language} ${p.language_version}`,
|
||||
monochrome: p => `${p.language} ${p.language_version} ${p.installed ? '(INSTALLED)': ''}`,
|
||||
json: JSON.stringify
|
||||
color: p =>
|
||||
`${chalk[p.installed ? 'green' : 'red']('•')} ${p.language} ${
|
||||
p.language_version
|
||||
}`,
|
||||
monochrome: p =>
|
||||
`${p.language} ${p.language_version} ${
|
||||
p.installed ? '(INSTALLED)' : ''
|
||||
}`,
|
||||
json: JSON.stringify,
|
||||
};
|
||||
|
||||
exports.handler = async ({ axios }) => {
|
||||
const packages = await axios.get('/api/v2/packages');
|
||||
|
||||
const pkg_msg = packages.data
|
||||
.map(msg_format.color)
|
||||
.join('\n');
|
||||
const pkg_msg = packages.data.map(msg_format.color).join('\n');
|
||||
|
||||
console.log(pkg_msg);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue