style: Use command -v instead of which for availability checks
rc.d/anyenv, rc.d/screen, aliases.d/mc, and rc.d/startx were the last holdouts still using `which` to check tool availability. Every other file in rc.d/* already uses `command -v`, which doesn't depend on an external binary being installed.
This commit is contained in:
+2
-2
@@ -13,12 +13,12 @@ if [[ -z "${DISPLAY}" && $(id -u) -ge 1000 ]] ; then
|
||||
3) VT=vt3 ;;
|
||||
esac
|
||||
|
||||
if ( which ck-launch-session &> /dev/null )
|
||||
if ( command -v ck-launch-session &> /dev/null )
|
||||
then
|
||||
EXEC="exec ck-launch-session"
|
||||
fi
|
||||
|
||||
if ( which startx &> /dev/null )
|
||||
if ( command -v startx &> /dev/null )
|
||||
then
|
||||
${EXEC} startx 1> ~/.log/xsession-errors 2>&1 -- "${VT}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user