mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
fix deno task completion for jsonc
(cherry picked from commit f924f06df7
)
This commit is contained in:
parent
1562a6b99e
commit
25f16f0bfd
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ deno completions fish | source
|
||||||
|
|
||||||
# complete deno task
|
# complete deno task
|
||||||
set searchForDenoFilesCode '
|
set searchForDenoFilesCode '
|
||||||
|
import * as JSONC from "https://deno.land/std@0.208.0/jsonc/mod.ts";
|
||||||
// order matters
|
// order matters
|
||||||
const denoFile = ["deno.json", "deno.jsonc", "package.json"];
|
const denoFile = ["deno.json", "deno.jsonc", "package.json"];
|
||||||
for (const file of denoFile) {
|
for (const file of denoFile) {
|
||||||
|
@ -10,7 +11,7 @@ for (const file of denoFile) {
|
||||||
// file exists
|
// file exists
|
||||||
const props = file === "package.json" ? "scripts" : "tasks";
|
const props = file === "package.json" ? "scripts" : "tasks";
|
||||||
console.log(
|
console.log(
|
||||||
Object.keys(JSON.parse(Deno.readTextFileSync(file))[props]).join("\n"),
|
Object.keys(JSONC.parse(Deno.readTextFileSync(file))[props]).join("\n"),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
Loading…
Reference in a new issue