eza now support aarch64!

This commit is contained in:
Konano 2024-09-14 10:57:49 +08:00
parent ebce2cf669
commit 76774e7116
Signed by: Nano
GPG Key ID: 93686B78EE43A65A
4 changed files with 39 additions and 2 deletions

View File

@ -82,10 +82,10 @@ configure_install_new() {
configure_install_eza() { configure_install_eza() {
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
brew install eza brew install eza
elif [[ $(uname -m) != "x86_64" ]]; then elif [[ $(uname -m) != "x86_64" && $(uname -m) != "aarch64" ]]; then
echo "eza is not supported on $(uname -m)." echo "eza is not supported on $(uname -m)."
elif ! command_exists eza; then elif ! command_exists eza; then
unzip $scriptdir/files/eza_x86_64-unknown-linux-musl.zip -d $tempdir/eza unzip $scriptdir/files/eza_$(uname -m)-unknown-linux-musl.zip -d $tempdir/eza
sudo cp $tempdir/eza/eza /usr/local/bin/ sudo cp $tempdir/eza/eza /usr/local/bin/
rm $tempdir/eza -r rm $tempdir/eza -r
fi fi

Binary file not shown.

37
update_file.py Normal file
View File

@ -0,0 +1,37 @@
import requests
def eza_get_latest_version():
url = "https://api.github.com/repos/eza-community/eza/releases/latest"
response = requests.get(url)
if response.status_code == 200:
latest_release = response.json()
return latest_release['tag_name'].lstrip('v')
return None
def eza_download_latest_version(version):
download_url = f"https://github.com/eza-community/eza/releases/download/v{version}/eza_x86_64-unknown-linux-musl.zip"
response = requests.get(download_url)
if response.status_code == 200:
with open(f"files/eza_x86_64-unknown-linux-musl.zip", "wb") as file:
file.write(response.content)
print(f"Downloaded eza version {version} (x86_64) successfully.")
else:
print(f"Failed to download eza version {version}.")
download_url = f"https://github.com/eza-community/eza/releases/download/v{version}/eza_aarch64-unknown-linux-gnu.zip"
response = requests.get(download_url)
if response.status_code == 200:
with open(f"files/eza_aarch64-unknown-linux-gnu.zip", "wb") as file:
file.write(response.content)
print(f"Downloaded eza version {version} (x86_64) successfully.")
else:
print(f"Failed to download eza version {version}.")
if __name__ == "__main__":
latest_version = eza_get_latest_version()
if (latest_version):
eza_download_latest_version(latest_version)
else:
print("Failed to get the latest eza version.")