mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-16 06:54:03 +00:00
Merge deno completions update from #9676
(Can't cherry-pick because GitHub tricked me into rebasing instead of squashing.)
This commit is contained in:
parent
e00f63b9e9
commit
80b31e87ec
1 changed files with 18 additions and 0 deletions
|
@ -1 +1,19 @@
|
||||||
deno completions fish | source
|
deno completions fish | source
|
||||||
|
|
||||||
|
# complete deno task
|
||||||
|
set searchForDenoFilesCode '
|
||||||
|
// order matters
|
||||||
|
const denoFile = ["deno.json", "deno.jsonc", "package.json"];
|
||||||
|
for (const file of denoFile) {
|
||||||
|
try {
|
||||||
|
Deno.statSync(file);
|
||||||
|
// file exists
|
||||||
|
const props = file === "package.json" ? "scripts" : "tasks";
|
||||||
|
console.log(
|
||||||
|
Object.keys(JSON.parse(Deno.readTextFileSync(file))[props]).join("\n"),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
complete -f -c deno -n "__fish_seen_subcommand_from task" -n "__fish_is_nth_token 2" -a "(deno eval '$searchForDenoFilesCode')"
|
||||||
|
|
Loading…
Reference in a new issue