fix the gum install on raspberry pi devices

This commit is contained in:
urban
2023-09-01 00:12:49 +02:00
parent ec829f5fb4
commit e146dfb05c
4 changed files with 27 additions and 33 deletions

View File

@@ -3,5 +3,5 @@
||.. ' || .. ... ... ... .. ... || .. .... .. ... ||.. ' || .. ... ... ... .. ... || .. .... .. ...
''|||. ||' || || || ||' '' || || .' .|...|| || || ''|||. ||' || || || ||' '' || || .' .|...|| || ||
. '|| || || || || || || ||'|. || || || . '|| || || || || || || ||'|. || || ||
|'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi.io\033[0m (v 1.0) |'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi\033[0m (v 1.0)

View File

@@ -1,12 +1,16 @@
install_prerequisites(){ install_prerequisites(){
p "Installing pre-requisites..." p "Installing pre-requisites..."
spin_it "goland-go (1/6)" sudo apt-get install -y golang-go sudo mkdir -p /etc/apt/keyrings
spin_it "gum       (2/6)" go install github.com/charmbracelet/gum@latest curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/charm.gpg
spin_it "git       (3/6)" sudo apt-get install -y git echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list >/dev/null
spin_it "tor       (4/6)" sudo apt-get install -y tor
spin_it "curl      (5/6)" sudo apt-get install -y curl spin_it "Update cache..." sudo apt update
spin_it "screen    (6/6)" sudo apt-get install -y screen spin_it "apt install gum                                                           \033[32m✓\033[0m" sudo apt-get install -y gum
spin_it "apt install git                                                           \033[32m✓\033[0m" sudo apt-get install -y git
spin_it "apt install tor                                                           \033[32m✓\033[0m" sudo apt-get install -y tor
spin_it "apt install curl                                                          \033[32m✓\033[0m" sudo apt-get install -y curl
spin_it "apt install screen                                                        \033[32m✓\033[0m" sudo apt-get install -y screen
} }
go_to_install_directory(){ go_to_install_directory(){
@@ -50,16 +54,12 @@ check_if_root(){
p_ok "We are root :)" p_ok "We are root :)"
} }
do_update() {
spin_it "Updating, please wait..." sudo apt-get update
}
check_if_upgrade(){ check_if_upgrade(){
UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^) UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^)
if (( UPGRADABLE_COUNT > 0 )); then if (( UPGRADABLE_COUNT > 0 )); then
p_warn "There are $UPGRADABLE_COUNT packages that can be upgraded." p_warn "There are $UPGRADABLE_COUNT packages that can be upgraded."
p_warn "It is recommended to run 'sudo apt upgrade' after ShurikenPi installation" p_warn "It is recommended to run 'sudo apt upgrade' afterwards."
else else
p "All packages are up to date." p "All packages are up to date."
fi fi
@@ -71,7 +71,8 @@ clone_repository(){
# Entry point # Entry point
check_if_root check_if_root
do_update echo ""
p "The next steps might take some time, be patient"
install_prerequisites install_prerequisites
check_if_upgrade check_if_upgrade
go_to_install_directory go_to_install_directory

View File

@@ -29,10 +29,6 @@ p_warn(){
echo -e " \033[33m!\033[0m $1" echo -e " \033[33m!\033[0m $1"
} }
gum(){
~/go/bin/gum $@
}
msg() { msg() {
echo "" echo ""
echo -e "$(cat ../Messages/$1)" echo -e "$(cat ../Messages/$1)"

View File

@@ -62,10 +62,6 @@ p_warn(){
echo -e " \033[33m!\033[0m $1" echo -e " \033[33m!\033[0m $1"
} }
gum(){
~/go/bin/gum $@
}
msg() { msg() {
echo "" echo ""
echo -e "$(cat ../Messages/$1)" echo -e "$(cat ../Messages/$1)"
@@ -120,12 +116,16 @@ spin_it(){
install_prerequisites(){ install_prerequisites(){
p "Installing pre-requisites..." p "Installing pre-requisites..."
spin_it "goland-go (1/6)" sudo apt-get install -y golang-go sudo mkdir -p /etc/apt/keyrings
spin_it "gum       (2/6)" go install github.com/charmbracelet/gum@latest curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/charm.gpg
spin_it "git       (3/6)" sudo apt-get install -y git echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list >/dev/null
spin_it "tor       (4/6)" sudo apt-get install -y tor
spin_it "curl      (5/6)" sudo apt-get install -y curl spin_it "Update cache..." sudo apt update
spin_it "screen    (6/6)" sudo apt-get install -y screen spin_it "apt install gum                                                           \033[32m✓\033[0m" sudo apt-get install -y gum
spin_it "apt install git                                                           \033[32m✓\033[0m" sudo apt-get install -y git
spin_it "apt install tor                                                           \033[32m✓\033[0m" sudo apt-get install -y tor
spin_it "apt install curl                                                          \033[32m✓\033[0m" sudo apt-get install -y curl
spin_it "apt install screen                                                        \033[32m✓\033[0m" sudo apt-get install -y screen
} }
go_to_install_directory(){ go_to_install_directory(){
@@ -169,16 +169,12 @@ check_if_root(){
p_ok "We are root :)" p_ok "We are root :)"
} }
do_update() {
spin_it "Updating, please wait..." sudo apt-get update
}
check_if_upgrade(){ check_if_upgrade(){
UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^) UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^)
if (( UPGRADABLE_COUNT > 0 )); then if (( UPGRADABLE_COUNT > 0 )); then
p_warn "There are $UPGRADABLE_COUNT packages that can be upgraded." p_warn "There are $UPGRADABLE_COUNT packages that can be upgraded."
p_warn "It is recommended to run 'sudo apt upgrade' after ShurikenPi installation" p_warn "It is recommended to run 'sudo apt upgrade' afterwards."
else else
p "All packages are up to date." p "All packages are up to date."
fi fi
@@ -190,7 +186,8 @@ clone_repository(){
# Entry point # Entry point
check_if_root check_if_root
do_update echo ""
p "The next steps might take some time, be patient"
install_prerequisites install_prerequisites
check_if_upgrade check_if_upgrade
go_to_install_directory go_to_install_directory