From b7ea8b24cbbcb31bf38aad4891f7aa846233cfbd Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 10 Sep 2024 14:29:06 -0400 Subject: [PATCH] feat: svu: infer sub-package Related: https://github.com/caarlos0/svu/pull/161 --- modules/pkgs.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/pkgs.nix b/modules/pkgs.nix index 3c6d073..59a6355 100644 --- a/modules/pkgs.nix +++ b/modules/pkgs.nix @@ -27,7 +27,16 @@ in { # Dev tools nodejs - svu + (pkgs.writeScriptBin "svu" '' + #!/usr/bin/env bash + root=$(git rev-parse --show-toplevel) + if [ "$PWD" != "$root" ]; then + local prefix=$(echo -n "$PWD" | sed "s|$root/||g") + ${pkgs.svu}/bin/svu --prefix="$prefix/v" --pattern="$prefix/*" "$@" + else + ${pkgs.svu}/bin/svu "$@" + fi + '') yarn # DevOps