-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_eza.sh
executable file
·73 lines (68 loc) · 3.03 KB
/
install_eza.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
if ! test -f checks/check_system.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/checks/check_system.sh)"
else
. ./checks/check_system.sh
fi
if ! test -f aliases/.bash_aliases.d/00-rlwrap_scripts.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/aliases/.bash_aliases.d/00-rlwrap_scripts.sh)"
else
. ./aliases/.bash_aliases.d/00-rlwrap_scripts.sh
fi
if ! type cargo &> /dev/null; then
if ! test -f install_cargo.sh; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/install_cargo.sh)"
else
./install_cargo.sh
fi
fi
type eza &> /dev/null && ezv=$(eza -v | awk 'NR==2{print $1;}' | tr 'v' ' ')
carv=$(cargo search 'eza = # A modern replacement for ls' | awk 'NR==1{print $3;}' | tr '"' ' ')
if ! type eza &> /dev/null || version-higher $carv $ezv; then
if type eza &> /dev/null && ! test -z "$pac_rm"; then
yes | ${pac_rm} eza
else
printf "Installing cargo version for eza (latest) but unable to remove current version for eza.\n Package manager probably unkown, try uninstalling manually.\n"
fi
cargo install --locked eza
#if test $distro_base == 'Arch'; then
# eval "$pac_ins eza"
#elif test $distro_base == 'Debian'; then
# eval "$pac_up"
# eval "$pac_ins 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
# eval "$pac_up"
# eval "$pac_ins eza"
#elif test $distro == 'Fedora'; then
# sudo dnf install eza
#elif test $distro == 'Gentoo'; then
# emerge --ask sys-apps/eza
#elif test $distro == 'openSuse'; then
# zypper ar https://download.opensuse.org/tumbleweed/repo/oss/ factory-oss
# zypper in eza
#elif test $machine == 'Mac' && type brew &> /dev/null; then
# brew install eza
#elif test $machine == 'Windows'; then
# winget install eza
#elif type nix-env &> /dev/null; then
# nix-env -i eza
#elif test $distro_base == "Nix"; then
# nix profile install nixpkgs#eza
#else
# cargo install eza
#fi
fi
if ! test -f ~/.bash_completion.d/eza; then
reade -Q 'GREEN' -i 'y' -p 'Install bash completions for eza? [Y/n]: ' 'n' bash_cm
if test $bash_cm == 'y'; then
if ! test -f checks/check_completions_dir.sh; then
eval "$(curl -fsSL https://raw.githubusercontent.com/excited-bore/dotfiles/main/checks/check_completions_dir.sh)"
else
. ./checks/check_completions_dir.sh
fi
wget -P ~/.bash_completion.d/ https://raw.githubusercontent.com/eza-community/eza/refs/heads/main/completions/bash/eza
fi
fi
unset bash_cm