Compare commits
2 Commits
b2a8a747cf
...
76774e7116
| Author | SHA1 | Date | |
|---|---|---|---|
| 76774e7116 | |||
| ebce2cf669 |
@ -82,10 +82,10 @@ configure_install_new() {
|
||||
configure_install_eza() {
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
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)."
|
||||
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/
|
||||
rm $tempdir/eza -r
|
||||
fi
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"registry-mirrors": [
|
||||
"https://registry.cn-beijing.aliyuncs.com",
|
||||
"https://mirror.ccs.tencentyun.com"
|
||||
"https://d.nano.ac",
|
||||
"https://docker-registry.infra.i2sec.cc:50001"
|
||||
],
|
||||
"insecure-registries": [
|
||||
"localhost:5000"
|
||||
|
||||
BIN
files/eza_aarch64-unknown-linux-gnu.zip
Normal file
BIN
files/eza_aarch64-unknown-linux-gnu.zip
Normal file
Binary file not shown.
Binary file not shown.
37
update_file.py
Normal file
37
update_file.py
Normal 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.")
|
||||
Loading…
Reference in New Issue
Block a user