From f433d8313946a1dcf7d8be09fe401344aed9de6f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 12 May 2024 12:38:11 +0200 Subject: patch prettierd to work with apheleia --- overlays/node-packages/default.nix | 5 ++++- overlays/node-packages/prettierd.patch | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 overlays/node-packages/prettierd.patch (limited to 'overlays') diff --git a/overlays/node-packages/default.nix b/overlays/node-packages/default.nix index 3e5c9259..b89a10a3 100644 --- a/overlays/node-packages/default.nix +++ b/overlays/node-packages/default.nix @@ -1,6 +1,9 @@ self: super: { nodePackages = super.nodePackages.extend (final: prev: - super.callPackage ./prettier-plugin-go-template { } + super.callPackage ./prettier-plugin-go-template { } // { } ); + prettierd = super.prettierd.overrideAttrs (old: { + patches = [ ./prettierd.patch ]; + }); } diff --git a/overlays/node-packages/prettierd.patch b/overlays/node-packages/prettierd.patch new file mode 100644 index 00000000..9abb572d --- /dev/null +++ b/overlays/node-packages/prettierd.patch @@ -0,0 +1,32 @@ +diff --git a/src/service.ts b/src/service.ts +index 93164e5..eafc38f 100644 +--- a/src/service.ts ++++ b/src/service.ts +@@ -153,8 +153,26 @@ function parseCLIArguments(args: string[]): [CLIArguments, string, CliOptions] { + parsedArguments.ignorePath = nextArg.value; + break; + } ++ case "--stdin-filepath": { ++ const nextArg = argsIterator.next(); ++ if (nextArg.done) { ++ throw new Error("--stdin-filepath option expects a file path"); ++ } ++ ++ fileName = nextArg.value; ++ break; ++ } + default: { +- optionArgs.push(arg); ++ if (arg.includes("=")) { ++ optionArgs.push(arg); ++ } else { ++ const nextArg = argsIterator.next(); ++ if (nextArg.done) { ++ throw new Error(`--${arg} expects a value`); ++ } ++ ++ optionArgs.push(`${arg}=${nextArg.value}`); ++ } + } + } + } else { -- cgit 1.4.1