fix 'command -v' not in csh (#45845)

This commit is contained in:
Ray Huang 2024-10-03 01:15:35 +08:00 committed by GitHub
parent 20aec1536a
commit 470774687d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,9 +62,9 @@ if (! $?SPACK_PYTHON) then
setenv SPACK_PYTHON ""
endif
foreach cmd ("$SPACK_PYTHON" python3 python python2)
command -v "$cmd" >& /dev/null
set status=`which "$cmd" >& /dev/null; echo $?`
if ($status == 0) then
setenv SPACK_PYTHON `command -v "$cmd"`
setenv SPACK_PYTHON `which "$cmd"`
break
endif
end