Skip to content

Commit

Permalink
* Moving files around to have a cleaner root
Browse files Browse the repository at this point in the history
* Updated install.sh
* Changed README.md to include image.
* Fixed issue with installer.
  • Loading branch information
jordantrizz committed Mar 29, 2023
1 parent 4aa6bed commit 6fbd051
Show file tree
Hide file tree
Showing 16 changed files with 819 additions and 89 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# zshbop
This is my custom ZSH configuration. It uses antidote ~~antigen~~ to install ZSH plugins.
<p align="center"><img src="https://user-images.githubusercontent.com/345869/228565610-dbd52f13-ee2a-454a-84f8-9d3e0b2438c7.png" alt="ZSHBOP"></p>

This is my custom ZSH configuration. It uses antidote to install ZSH plugins.

<a href="https://jordantrask.com/coffee" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>

Expand Down Expand Up @@ -48,9 +49,15 @@ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
|---------------------|---------------|
| Quick Install | ```bash <(curl -sL https://zshrc.pl)``` |
| Fallback Install | ```bash <(curl -sL https://raw.githubusercontent.com/jordantrizz/zshbop/master/install.sh)``` |
| Development Install | ```bash <(curl -sL https://raw.githubusercontent.com/jordantrizz/zshbop/develop/install.sh)``` |
| Development Install | ```bash <(curl -sL https://raw.githubusercontent.com/jordantrizz/zshbop/develop/install.sh)``` |
| Bleeding Install | ```bash <(curl -sL https://raw.githubusercontent.com/jordantrizz/zshbop/bleeding/install.sh)```|

# Branches
* main - production releases, fully functional.
* dev - development releases that are somewhat functional.
* bleeding - bleeding releases that most likely won't work.

## Advanced Install
# Advanced Install
<details><summary>Click to Reveal Advanced Install</summary>
<p>
If you don't want to have zsh within your home directory, then use the following.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
175 changes: 103 additions & 72 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
# -- zshbop Install script
# ------------------------

# ------------
# -- Variables
# ------------
VERSION="0.0.2"
VERSION="0.0.3"
SKIPDEP="0"
HELP="0"
REQUIRED_SOFTWARE=('jq' 'curl' 'zsh' 'git' 'md5sum' 'sudo' 'screen' 'git' 'joe')
Expand All @@ -22,20 +20,13 @@ GREENBG="\033[0;42m"
DARKGREYBG="\033[0;100m"
ECOL="\033[0;0m"

# ------------
# -- Functions
# ------------

# -- _error
_error () { echo -e "${RED}** ERROR ** - $@ ${ECOL}"; }
_warning () { echo -e "${YELLOW}** ERROR ** - $@ ${ECOL}"; }
_success () { echo -e "${GREEN}** SUCCESS ** - $@ ${ECOL}"; }
_running () { echo -e "${BLUEBG}${@}${ECOL}"; }


# ------------
# -- Functions
# ------------
_error () { echo -e "${RED}** ERROR ** - ${*} ${ECOL}"; }
_warning () { echo -e "${YELLOW}** ERROR ** - ${*} ${ECOL}"; }
_success () { echo -e "${GREEN}** SUCCESS ** - ${*} ${ECOL}"; }
_running () { echo -e "${BLUEBG}${*}${ECOL}"; }
_install () { echo -e "${GREENBG}${*}${ECOL}"; }
_debug () { if [[ $DEBUG == "1" ]]; then echo -e "${CYAN}*** DEBUG: ${*}${ECOL}"; fi; }

# -- usage
usage () {
Expand All @@ -45,6 +36,7 @@ USAGE=\
Options
-h - This help screen
-s - Skip dependencies
-d - Debug mode
Commands
Expand All @@ -61,28 +53,60 @@ Version: ${VERSION}
echo "$USAGE"
}

# -- zshbop_banner
zshbop_banner () {
echo " _ _ ";
echo " | | | | ";
echo " ____ ___ | |__ | |__ ___ _ __ ";
echo "|_ // __|| '_ \ | '_ \ / _ \ | '_ \ ";
echo " / / \__ \| |_) || |_) || (_) || |_) |";
echo "/___||___/|_.__/ |_.__/ \___/ | .__/ ";
echo " | | ";
echo " |_| ";
}

# -- flight_check
flight_check() {
# Checking if zsh is installed
TOOLS_INSTALL=('')
_running "Checking if required software are installed"
for tool in ${REQUIRED_SOFTWARE[@]}; do
if ! [ -x "$(command -v $tool)" ]; then
_error "$tool is not installed."
TOOLS_INSTALL+=("$tool")
else
TOOL_PATH=`which $tool`
_success "$tool is installed in $TOOL_PATH"
fi
done
if [[ -z TOOLS_INSTALL ]]; then
_success "Not need to install any software"
pre_flight_check () {
# -- Pre-flight Check
_debug "Running pre_flight_check"
if [[ $SKIPDEP == "0" ]]; then
_running "Running pre-flight Check"
local TOOLS_INSTALL

_debug "Checking if required software are installed"
_debug "\$REQUIRED_SOFTWARE: ${REQUIRED_SOFTWARE[*]}"
for tool in "${REQUIRED_SOFTWARE[@]}"; do
if ! [ -x "$(command -v $tool)" ]; then
_error "$tool is not installed."
TOOLS_INSTALL+=("$tool")
else
TOOL_PATH=`which $tool`
_debug "$tool is installed in $TOOL_PATH"
fi
done
_debug "\$TOOLS_INSTALL: ${TOOLS_INSTALL[*]}"
if [[ ${#TOOLS_INSTALL[@]} -eq 0 ]]; then
_debug "No software to install, proceeding."
else
_running "Installing required packages..."
echo " Packages: ${TOOLS_INSTALL[*]}"
echo ""
read -p "Do you want to install the software above? (y/n): " choice
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo ""
echo "${YELLOW}****************************************************${ECOL}"
apt-get install -y --no-install-recommends "${TOOLS_INSTALL[@]}"
echo "${YELLOW}****************************************************${ECOL}"
echo ""
elif [ "$choice" == "n" ] || [ "$choice" == "N" ]; then
echo "Not installing the software...continuing"
else
echo "Invalid choice. Please enter 'y' or 'n'."
fi
fi
else
_running "Installing required tools...${TOOLS_INSTALL[@]}"
apt-get install -y --no-install-recommends "${TOOLS_INSTALL[@]}"

_running "Skipping pre-flight check and installing required packages."
fi
return
}

# -- check_zsh_default
Expand All @@ -98,34 +122,37 @@ check_zsh_default () {
}

# -- pkg_install - install packafges.
pkg_install() {
pkg_install () {
# Checking what package manager we have
_running "Checking what package manager we have...."
if [ -x "$(command -v apt-get)" ]; then
echo " - We have apt!"
sudo apt install $@
sudo apt install "${*}"
elif [ -x "$(command -v yum)" ]; then
echo " - We have yum!"
sudo yum install $@
sudo yum install "${*}"
elif [ -x "$(command -v brew)" ]; then
echo " - We have brew!"
brew install $@
brew install "${*}"
else
_error "Can't detect package manager :("
fi

$(${PKG_MANAGER})
if [ $? -eq 1 ]; then
_error "$@ install failed...."
_error "${*} install failed...."
exit 1
else
_success "$@ installed successfully"
_success "${*} installed successfully"
fi
}

# -- install_method - how do you want to install zshbop?
install_method() {
echo "Install (d)efaults or (c)ustomize? (d/c)?"
install_method () {
zshbop_banner
echo ""
_install "Starting zshbop install"
echo "Install (d)efaults or (c)ustomize? (d/c)?"
read INSTALL

if [ $INSTALL == "d" ];then
Expand Down Expand Up @@ -204,50 +231,49 @@ setup_system() {
fi
}


# -------
# -- Main
# -------

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
_debug "ARGS: ${*}"

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"

case $key in
-h|--help)
HELP="1"
shift # past argument
;;
-s|--skipdep)
SKIPDEP="1"
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
case $key in
-h|--help)
HELP="1"
shift # past argument
;;
-s|--skipdep)
SKIPDEP="1"
shift # past argument
;;
-d)
DEBUG="1"
shift # past argument
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters

# -- set $CMD
CMD="$1"

# -- Pre-flight Check
if [[ $SKIPDEP == "0" ]]; then
_running "Running pre-flight Check"
flight_check
else
_running "Skipping pre-flight check"
fi

# -- help
if [[ $HELP == "1" ]];then
usage
exit
# -- clean
elif [[ $CMD == "clean" ]]; then
_running "Removing zshbop ###"
_running "Removing zshbop from system"
echo "Continue (y/n)?"
read CLEAN
if [ $CLEAN == "y" ]; then
Expand All @@ -262,14 +288,17 @@ elif [[ $CMD == "clean" ]]; then
fi
# -- default
elif [[ $CMD == "default" ]]; then
pre_flight_check
INSTALL=d
# -- home
elif [[ $CMD == "home" ]]; then
pre_flight_check
INSTALL=c
BRANCH=m
INSTALL_LOCATION=h
# -- git
elif [[ $CMD == "git" ]]; then
pre_flight_check
INSTALL=c
BRANCH=d
INSTALL_LOCATION=g
Expand All @@ -279,11 +308,13 @@ elif [[ $CMD == "custom" ]]; then
usage
exit 1
else
pre_flight_check
INSTALL=c
BRANCH="$2"
INSTALL_LOCATION="$3"
fi
else
pre_flight_check
install_method
fi

Expand Down
3 changes: 3 additions & 0 deletions kb/gridpane.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ The below example will set the redis maxmemory to 300MB
gp stack redis -max-memory 300
```
<<<<<<< HEAD

# Redis Object Cache
## Change Redis maxmemory
Expand All @@ -129,6 +130,8 @@ The below example will set the redis maxmemory to 300MB
gp stack redis -max-memory 300
```
=======
>>>>>>> bleeding
# PHP
## Change PHP Settings
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion kb/microsoft365.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Other
## Enable App Passwords
https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9
=======
# Other
## Enable App Passwords
https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9
Expand Down
2 changes: 1 addition & 1 deletion aliases.zsh → lib/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function scrc {
# - ssh
alias sshc="ssh-connect"
function sshr { ssh root@$1 }
alias ssh-keygen="ssh-keygen -t ed25519"

# - Litespeed
alias lsphp74="/usr/local/lsws/lsphp74/bin/php"
alias lsphp81="/usr/local/lsws/lsphp81/bin/php"
alias ssh-keygen="ssh-keygen -t ed25519"
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6fbd051

Please sign in to comment.