Refactor scripts to use command -v instead of which (#20306)
`which` is not a core package is some distributions. Included changes from #20309 Release Notes: - N/A
This commit is contained in:
+3
-3
@@ -33,11 +33,11 @@ main() {
|
||||
;;
|
||||
esac
|
||||
|
||||
if which curl >/dev/null 2>&1; then
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl () {
|
||||
command curl -fL "$@"
|
||||
}
|
||||
elif which wget >/dev/null 2>&1; then
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
curl () {
|
||||
wget -O- "$@"
|
||||
}
|
||||
@@ -48,7 +48,7 @@ main() {
|
||||
|
||||
"$platform" "$@"
|
||||
|
||||
if [ "$(which "zed")" = "$HOME/.local/bin/zed" ]; then
|
||||
if [ "$(command -v zed)" = "$HOME/.local/bin/zed" ]; then
|
||||
echo "Zed has been installed. Run with 'zed'"
|
||||
else
|
||||
echo "To run Zed from your terminal, you must add ~/.local/bin to your PATH"
|
||||
|
||||
Reference in New Issue
Block a user