From 3c31918b73d3e76303d8dc23b354938f39fb86dc Mon Sep 17 00:00:00 2001 From: KAiZ <24286590+KaizIqbal@users.noreply.github.com> Date: Thu, 14 Nov 2019 08:50:42 +0530 Subject: [PATCH] quick installation script --- Bibata.sh | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 Bibata.sh diff --git a/Bibata.sh b/Bibata.sh new file mode 100755 index 00000000..7f5bda1e --- /dev/null +++ b/Bibata.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +# Default settings +BIBATA=${BIBATA:-~/.Bibata} +REPO=${REPO:-KaizIqbal/Bibata_Cursor} +REMOTE=${REMOTE:-https://github.com/${REPO}.git} +BRANCH=${BRANCH:-devlopment} + +command_exists() { + command -v "$@" >/dev/null 2>&1 +} + +error() { + echo ${RED}"Error: $@"${RESET} >&2 +} + +setup_color() { + # Only use colors if connected to a terminal + if [ -t 1 ]; then + RED=$(printf '\033[31m') + GREEN=$(printf '\033[32m') + YELLOW=$(printf '\033[33m') + BLUE=$(printf '\033[34m') + BOLD=$(printf '\033[1m') + RESET=$(printf '\033[m') + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + RESET="" + fi +} + +setup_bibata_repo() { + + echo "${BLUE}Cloning Bibata Cursor...${RESET}" + + command_exists git || { + error "git is not installed" + exit 1 + } + + git clone -c core.eol=lf -c core.autocrlf=false \ + -c fsck.zeroPaddedFilemode=ignore \ + -c fetch.fsck.zeroPaddedFilemode=ignore \ + -c receive.fsck.zeroPaddedFilemode=ignore \ + --depth=1 --branch "$BRANCH" "$REMOTE" "$BIBATA" || { + error "git clone of bibata_cursor repo failed" + exit 1 + } + + echo +} + +setup_bibata() { + cd ~/.Bibata/ + ./install.sh + cd ~ + rm -rf .Bibata + #echo +} + +main() { + + printf "$GREEN" + cat <<-'EOF' + + ██████╗ ██╗██████╗ █████╗ ████████╗ █████╗ + ██╔══██╗██║██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗ + ██████╔╝██║██████╔╝███████║ ██║ ███████║ + ██╔══██╗██║██╔══██╗██╔══██║ ██║ ██╔══██║ + ██████╔╝██║██████╔╝██║ ██║ ██║ ██║ ██║ + ╚═════╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ + + EOF + printf "$RESET" + + setup_color + setup_bibata_repo + setup_bibata + + cd ~ + rm -rf .Bibata + printf "$RESET" +} + +main "$@"