Skip to content

Commit

Permalink
feat: 📝 update installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
OnCloud125252 committed Apr 25, 2024
1 parent a73f98a commit f3da23a
Showing 2 changed files with 42 additions and 3 deletions.
Empty file modified build.sh
100644 → 100755
Empty file.
45 changes: 42 additions & 3 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
#!/bin/bash
wget https://github.com/Ui-CLI/ui-cli/releases/download/v0.1.0/ui-cli_0.1.0_linux_amd64.tar.gz
tar -xvf ui-cli_0.1.0_linux_amd64.tar.gz
sudo cp ui /usr/local/bin

# Colors
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
NC='\033[0m' # No Color

# Symbols
CHECKMARK='\xE2\x9C\x94'
ROCKET='\xF0\x9F\x9A\x80'
CROSSMARK='\xE2\x9C\x98'
HOURGLASS='\xE2\x8C\x9B'

# Variables
app_name=ui
download_link=https://github.com/Update-Install/CLI/releases/latest/download/ui-cli_linux_amd64

function install() {
sudo wget $download_link -q --show-progress --progress=bar:force -O /usr/local/bin/$app_name
sudo chmod +x /usr/local/bin/$app_name
}

if [ -f /usr/local/bin/$app_name ]; then
echo -e -n "${YELLOW}Warning: App named $app_name already exists in /usr/local/bin. Do you want to overwrite it? (y/N): ${NC}"
read -n 1 -r
echo

sudo -v

if [[ $REPLY =~ ^[Yy]$ ]]; then
echo -e "${GREEN}Updating $app_name...${NC}"
install
else
echo -e "${RED}Installation aborted.${NC}"
exit 1
fi
else
echo -e "${GREEN}Installing $app_name...${NC}"
install
fi

0 comments on commit f3da23a

Please sign in to comment.