From 1bd3a2dcb809ae8cff6a53a62a9e9c1a7b82dad9 Mon Sep 17 00:00:00 2001 From: Frank Qing Date: Wed, 28 May 2025 04:07:10 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(install.sh):=20update=20eza=20inst?= =?UTF-8?q?allation=20logic=20to=20install=20via=20cargo=20if=20Rust=20is?= =?UTF-8?q?=20not=20present,=20removing=20previous=20GPG=20and=20repositor?= =?UTF-8?q?y=20setup=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index ee8b0f7..e188b07 100755 --- a/install.sh +++ b/install.sh @@ -48,16 +48,15 @@ install_eza_fallback() { echo "Attempting fallback installation of eza..." case $os in ubuntu|debian) - # Ensure gpg exists and add the community repo - command -v gpg &> /dev/null || sudo apt-get install -y gpg - sudo mkdir -p /etc/apt/keyrings - wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | \ - sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg - echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | \ - sudo tee /etc/apt/sources.list.d/gierens.list - sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list - sudo apt-get update - sudo apt-get install -y eza + # Install cargo if it doesn't exist + if ! command -v cargo &> /dev/null; then + echo "Installing Rust and cargo..." + sudo apt-get update + sudo apt-get install -y curl build-essential + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source ~/.cargo/env + fi + cargo install eza ;; fedora) sudo dnf install -y eza || {