Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Improve install-cmake script (#20836)
Peter Tripp5b317f60dff6
diff --git a/script/install-cmake b/script/install-cmakeindex 71b5aaeeef2..3a28aae1b87 100755--- a/script/install-cmake+++ b/script/install-cmake@@ -35,7 +35,7 @@ CMAKE_VERSION="${CMAKE_VERSION:-${1:-3.30.4}}"if [ "$(whoami)" = root ]; then SUDO=; else SUDO="$(command -v sudo || command -v doas || true)"; fi-if cmake --version | grep -q "$CMAKE_VERSION"; then+if cmake --version 2>/dev/null | grep -q "$CMAKE_VERSION"; thenecho "CMake $CMAKE_VERSION is already installed."exit 0elif [ -e /usr/local/bin/cmake ]; then@@ -51,7 +51,7 @@ elif [ -e /etc/lsb-release ] && grep -qP 'DISTRIB_ID=Ubuntu' /etc/lsb-release; techo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \| $SUDO tee /etc/apt/sources.list.d/kitware.list >/dev/null$SUDO apt-get update- $SUDO apt-get install -y kitware-archive-keyring cmake==$CMAKE_VERSION+ $SUDO apt-get install -y kitware-archive-keyring cmakeelsearch="$(uname -m)"if [ "$arch" != "x86_64" ] && [ "$arch" != "aarch64" ]; then