mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-29 06:15:24 -04:00
quick installation script
This commit is contained in:
parent
ab238a701a
commit
3c31918b73
1 changed files with 89 additions and 0 deletions
89
Bibata.sh
Executable file
89
Bibata.sh
Executable file
|
@ -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 "$@"
|
Loading…
Add table
Add a link
Reference in a new issue