From c55b4dbcd2af7ff8065ee4fece2c8793427ec88b Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Tue, 2 Apr 2024 10:48:33 +0200 Subject: [PATCH] lua: fix setup-hook *.lua matching the setup-hook checks if a derivation contains lua files matching lua_path patterns. We use bash's globstar extension for that but `**.lua` doesn't return files in subfolders, it has to be `**/*.lua`. Adjust the pattern accordingly. --- pkgs/development/interpreters/lua-5/hooks/setup-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh b/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh index cbc7b7b53e9b..302702166139 100644 --- a/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh +++ b/pkgs/development/interpreters/lua-5/hooks/setup-hook.sh @@ -25,8 +25,8 @@ addToLuaSearchPathWithCustomDelimiter() { # export only if the folder contains lua files shopt -s globstar - - for _file in ${absPattern/\?/\*\*}; do + local adjustedPattern="${absPattern/\?/\*\*\/\*}" + for _file in $adjustedPattern; do export "${varName}=${!varName:+${!varName};}${absPattern}" shopt -u globstar return;