mirror of
https://github.com/chenasraf/gaardian-alfred-workflow.git
synced 2026-05-17 17:48:02 +00:00
23 lines
564 B
JavaScript
23 lines
564 B
JavaScript
import list from './list.mjs'
|
|
|
|
function getMaps(name) {
|
|
return list.filter((item) => item.name.toLowerCase().includes(name.toLowerCase()))
|
|
}
|
|
|
|
const results = getMaps(process.argv[2])
|
|
const items = results.map((it) => ({
|
|
title: `Open Gaardian Map for "${it.name}"`,
|
|
arg: it.href,
|
|
}))
|
|
|
|
const qs = new URLSearchParams({ q: `aardwolf ${process.argv[2]}` }).toString()
|
|
|
|
// if (!items.length) {
|
|
items.push({
|
|
title: `Search for "aardwolf ${process.argv[2]}" on Google`,
|
|
arg: `https://www.google.com/search?${qs}`
|
|
})
|
|
// }
|
|
|
|
console.log(JSON.stringify({ items }))
|