You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
543 B
21 lines
543 B
const axios = require('../axios.js')
|
|
|
|
module.exports = async function (method, ...args) {
|
|
const endpoint = `https://formulae.brew.sh/api/formula/${args[0]}.json`
|
|
const { versions } = await axios.get(endpoint).then(res => res.data)
|
|
|
|
switch (method) {
|
|
case 'v':
|
|
return {
|
|
subject: 'homebrew',
|
|
status: 'v' + versions.stable,
|
|
color: versions.stable[0] === '0' ? 'orange' : 'blue'
|
|
}
|
|
default:
|
|
return {
|
|
subject: 'homebrew',
|
|
status: 'unknown',
|
|
color: 'grey'
|
|
}
|
|
}
|
|
}
|
|
|