mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:44:04 +08:00
25 lines
629 B
Fish
25 lines
629 B
Fish
deno completions fish | source
|
|
|
|
# complete deno task
|
|
set searchForDenoFilesCode '
|
|
const denoFile = ["deno.json", "deno.jsonc", "package.json"];
|
|
for (const file of denoFile) {
|
|
try {
|
|
Deno.statSync(file);
|
|
// file exists
|
|
if (file === "package.json") {
|
|
console.log(
|
|
Object.keys(JSON.parse(Deno.readTextFileSync(file)).scripts).join("\n"),
|
|
);
|
|
} else {
|
|
console.log(
|
|
Object.keys(JSON.parse(Deno.readTextFileSync(file)).tasks).join("\n"),
|
|
);
|
|
}
|
|
break;
|
|
} catch {
|
|
}
|
|
}
|
|
'
|
|
complete -f -c deno -n "__fish_seen_subcommand_from task" -a "(deno eval '$searchForDenoFilesCode')"
|