From e146dfb05c13394c602e9d313ab4fe9e757a1fce Mon Sep 17 00:00:00 2001 From: urban Date: Fri, 1 Sep 2023 00:12:49 +0200 Subject: [PATCH] fix the gum install on raspberry pi devices --- Messages/logo.txt | 2 +- Scripts/installer.sh | 25 +++++++++++++------------ Scripts/utils.sh | 4 ---- install.sh | 29 +++++++++++++---------------- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/Messages/logo.txt b/Messages/logo.txt index f9a7def..b4fcb4d 100644 --- a/Messages/logo.txt +++ b/Messages/logo.txt @@ -3,5 +3,5 @@ ||.. ' || .. ... ... ... .. ... || .. .... .. ... ''|||. ||' || || || ||' '' || || .' .|...|| || || . '|| || || || || || || ||'|. || || || - |'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi.io\033[0m (v 1.0) + |'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi\033[0m (v 1.0) \ No newline at end of file diff --git a/Scripts/installer.sh b/Scripts/installer.sh index 2b82a91..11ca3b3 100644 --- a/Scripts/installer.sh +++ b/Scripts/installer.sh @@ -1,12 +1,16 @@ install_prerequisites(){ p "Installing pre-requisites..." - spin_it "goland-go (1/6)" sudo apt-get install -y golang-go - spin_it "gum       (2/6)" go install github.com/charmbracelet/gum@latest - spin_it "git       (3/6)" sudo apt-get install -y git - spin_it "tor       (4/6)" sudo apt-get install -y tor - spin_it "curl      (5/6)" sudo apt-get install -y curl - spin_it "screen    (6/6)" sudo apt-get install -y screen + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/charm.gpg + 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 "Update cache..." sudo apt update + 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(){ @@ -50,16 +54,12 @@ check_if_root(){ p_ok "We are root :)" } -do_update() { - spin_it "Updating, please wait..." sudo apt-get update -} - check_if_upgrade(){ UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^) if (( UPGRADABLE_COUNT > 0 )); then 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 p "All packages are up to date." fi @@ -71,7 +71,8 @@ clone_repository(){ # Entry point check_if_root -do_update +echo "" +p "The next steps might take some time, be patient" install_prerequisites check_if_upgrade go_to_install_directory diff --git a/Scripts/utils.sh b/Scripts/utils.sh index d48cf72..40398ba 100644 --- a/Scripts/utils.sh +++ b/Scripts/utils.sh @@ -29,10 +29,6 @@ p_warn(){ echo -e " \033[33m!\033[0m $1" } -gum(){ - ~/go/bin/gum $@ -} - msg() { echo "" echo -e "$(cat ../Messages/$1)" diff --git a/install.sh b/install.sh index c2fa3d8..52c14b8 100755 --- a/install.sh +++ b/install.sh @@ -62,10 +62,6 @@ p_warn(){ echo -e " \033[33m!\033[0m $1" } -gum(){ - ~/go/bin/gum $@ -} - msg() { echo "" echo -e "$(cat ../Messages/$1)" @@ -120,12 +116,16 @@ spin_it(){ install_prerequisites(){ p "Installing pre-requisites..." - spin_it "goland-go (1/6)" sudo apt-get install -y golang-go - spin_it "gum       (2/6)" go install github.com/charmbracelet/gum@latest - spin_it "git       (3/6)" sudo apt-get install -y git - spin_it "tor       (4/6)" sudo apt-get install -y tor - spin_it "curl      (5/6)" sudo apt-get install -y curl - spin_it "screen    (6/6)" sudo apt-get install -y screen + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/charm.gpg + 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 "Update cache..." sudo apt update + 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(){ @@ -169,16 +169,12 @@ check_if_root(){ p_ok "We are root :)" } -do_update() { - spin_it "Updating, please wait..." sudo apt-get update -} - check_if_upgrade(){ UPGRADABLE_COUNT=$(apt list --upgradable 2>$LOGS| grep -c ^) if (( UPGRADABLE_COUNT > 0 )); then 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 p "All packages are up to date." fi @@ -190,7 +186,8 @@ clone_repository(){ # Entry point check_if_root -do_update +echo "" +p "The next steps might take some time, be patient" install_prerequisites check_if_upgrade go_to_install_directory