From 40f476c649e2c1938c391575f4339c6f50b97e7c Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Sat, 10 Feb 2024 12:46:08 +0100 Subject: fix(pkgctl): skip path arguments that are not directories Several subcommands accept multiple paths in a way that passing a wildcard is an expected use case. Previously this wasn't possible if the main directory contained any text files or scripts. Fix this by skipping none directory paths for such commands. Component: pkgctl Signed-off-by: Morten Linderud --- src/lib/repo/configure.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/repo/configure.sh') diff --git a/src/lib/repo/configure.sh b/src/lib/repo/configure.sh index b3c188c..0980fd1 100644 --- a/src/lib/repo/configure.sh +++ b/src/lib/repo/configure.sh @@ -207,9 +207,14 @@ pkgctl_repo_configure() { fi for path in "${paths[@]}"; do - if ! realpath=$(realpath -e "${path}"); then + # resolve symlink for basename + if ! realpath=$(realpath --canonicalize-existing -- "${path}"); then die "No such directory: ${path}" fi + # skip paths that aren't directories + if [[ ! -d "${realpath}" ]]; then + continue + fi pkgbase=$(basename "${realpath}") pkgbase=${pkgbase%.git} -- cgit v1.2.3-70-g09d2