Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Refactor scripts to use `command -v` instead of `which` (#20306)
Jeevitha Kannan K S4f06f5b8fe5b
diff --git a/script/bootstrap b/script/bootstrapindex 999a11749c8..454daf46e27 100755--- a/script/bootstrap+++ b/script/bootstrap@@ -11,7 +11,7 @@ elsefi# Install sqlx-cli if needed-if [[ "$(sqlx --version)" != "sqlx-cli 0.7.2" ]]; then+if ! [[ "$(command -v sqlx)" && "$(sqlx --version)" == "sqlx-cli 0.7.2" ]]; thenecho "sqlx-cli not found or not the required version, installing version 0.7.2..."cargo install sqlx-cli --version 0.7.2fidiff --git a/script/install.sh b/script/install.shindex daeaec181f7..3f2c690779d 100755--- a/script/install.sh+++ b/script/install.sh@@ -33,11 +33,11 @@ main() {;;esac- if which curl >/dev/null 2>&1; then+ if command -v curl >/dev/null 2>&1; thencurl () {command curl -fL "$@"}- elif which wget >/dev/null 2>&1; then+ elif command -v wget >/dev/null 2>&1; thencurl () {wget -O- "$@"}@@ -48,7 +48,7 @@ main() {"$platform" "$@"- if [ "$(which "zed")" = "$HOME/.local/bin/zed" ]; then+ if [ "$(command -v zed)" = "$HOME/.local/bin/zed" ]; thenecho "Zed has been installed. Run with 'zed'"elseecho "To run Zed from your terminal, you must add ~/.local/bin to your PATH"