all repos — nixfiles @ f433d8313946a1dcf7d8be09fe401344aed9de6f

System and user configuration, managed by nix and home-manager

patch prettierd to work with apheleia
Alan Pearce alan@alanpearce.eu
Sun, 12 May 2024 12:38:11 +0200
commit

f433d8313946a1dcf7d8be09fe401344aed9de6f

parent

647d704194342bbbd64c213fd35ee46f39579517

2 files changed, 36 insertions(+), 1 deletions(-)

jump to
M overlays/node-packages/default.nixoverlays/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 ];
+  });
 }
A 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 {