From e81ff077041a04fb070c4bced18a89585f39ddcc Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 11 Dec 2025 13:36:11 +0100 Subject: scripts/why-depends: Also work without a version argument --- scripts/why-depends | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts/why-depends') diff --git a/scripts/why-depends b/scripts/why-depends index 01471ce2..1afe9150 100755 --- a/scripts/why-depends +++ b/scripts/why-depends @@ -1,8 +1,13 @@ #! /usr/bin/env sh -package="$1" -version="$2" -shift 2 +search_string="$1-" +shift 1 + +if [ "$1" != "" ]; then + # Add the version + search_string="${search_string}${1}$" + shift 1 +fi if [ "$1" = "--running" ]; then shift 1 @@ -12,6 +17,7 @@ else base=".#nixosConfigurations.$host.config.system.build.toplevel" fi -fd "$package-$version$" /nix/store --type directory --threads 1 --exec nix why-depends "$@" "$base" + +fd "$search_string" /nix/store --type directory --threads 1 --exec nix why-depends "$@" "$base" # vim: ft=sh -- cgit 1.4.1