modulecmd: bugfix in test whether a file is a modulefile or not

This commit is contained in:
2024-08-13 16:32:07 +02:00
parent d3f6d400c4
commit 85cf207e9e
+2 -2
View File
@@ -470,8 +470,8 @@ is_modulefile() {
local -n im_interp="$1"
local -r fname="$2"
# does file exist and is readable?
[[ -r ${fname} ]] || return 2
# is this a regular, readable file?
[[ -f "${fname}" && -r "${fname}"]] || return 2
if [[ "${fname##*.}" == 'lua' ]]; then
im_interp="${Lmod_cmd}"