Skip to content

Commit

Permalink
Release 2.8.2
Browse files Browse the repository at this point in the history
(feat) added bat to software
(refactor) moved around some code
(feat) new command compare-dir
feat(software): Added software glint and update gc commad to detect if glint is installed
  • Loading branch information
jordantrizz committed May 23, 2023
1 parent b96bda3 commit b97ed6e
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 9 deletions.
19 changes: 19 additions & 0 deletions cmds/cmds-file.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -- file
_debug " -- Loading ${(%):-%N}"
help_files[cron]="Commands working with files in Linux" # Help file description
typeset -gA help_file # Init help array.

function compare-dirs () {
local DIR1=$1
local DIR2=$2

if [[ ! -d "$DIR1" || ! -d "$DIR2" ]]; then
echo "Usage: compare-dirs <dir1> <dir2>"
return 1
fi

diff -rq "$DIR1" "$DIR2"
}



11 changes: 10 additions & 1 deletion cmds/cmds-git.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ typeset -gA help_git
# - gc
help_git[gcp]='Git commit + push'
gc () {
git commit -am "$*" && git push
_cexists glint
if [[ $? == "0" ]]; then
_loading "Committing using glint"
glint commit
git push
else
_loading "Committing using git, consider glit (software glint)"
git commit -am "$*"
git push
fi
}

# - gbdc
Expand Down
50 changes: 48 additions & 2 deletions cmds/cmds-software.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,56 @@ function zsh-bin() {
# -- bat
help_software[bat]="Install bat"
function bat() {
_loading "Installing bats"
_loading "Installing bat"
if [[ $MACHINE_OS == "mac" ]]; then
brew install bat
elif [[ $MACHINE_OS == "linux" ]]; then
sudo apt install bat
fi
}
}

# -- glint
help_software[change]="Install glint - https://github.com/brigand/glint"
if [[ $MACHINE_OS == "linux" ]]; then
_cexists glint-linux
if [[ $? == "0" ]]; then
function glint () { glint-linux $* }
function software_glint { _success "Glint installed" }
else
function glint () { _error "Glint not installed, type software glint to install" }
function software_glint {
_loading "Installing glint"
curl -L -o $HOME/bin/glint-linux https://github.com/brigand/glint/releases/download/v6.3.4/glint-linux
chmod u+x $HOME/bin/glint-macos
_loading3 "Reload shell"
}
fi
elif [[ $MACHINE_OS == "mac" ]]; then
_cexists glint-macos
if [[ $? == "0" ]]; then
function glint () { glint-macos $* }
function software_glint { _success "Glint installed" }
else
function glint () { _error "Glint not installed, type software glint to install" }
function software_glint {
_loading "Installing glint"
curl -L -o $HOME/bin/glint-macos https://github.com/brigand/glint/releases/download/v6.3.4/glint-macos
chmod u+x $HOME/bin/glint-macos
_loading3 "Reload shell"
}
fi
fi

# -- change
help_software[change]="Install change - https://raw.githubusercontent.com/adamtabrams/change"
_cexists change
if [[ $? == "1" ]]; then
function change () {
if [[ ! -f $BIN/home ]]; then
_zshbop_bin
curl -s "https://raw.githubusercontent.com/adamtabrams/change/master/change" -o $HOME/bin
else
_zshbop_bin
fi
}
fi
6 changes: 5 additions & 1 deletion lib/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# -- zshbop functions -- This file contains all the functions for initializing zshbop
# -----------------------------------------------------------------------------------
_debug_load
source ${ZSHBOP_ROOT}/lib/colors.zsh # -- colors first!
source ${ZSHBOP_ROOT}/lib/functions-core.zsh # -- core functions
source ${ZSHBOP_ROOT}/lib/functions.zsh # -- zshbop functions
source ${ZSHBOP_ROOT}/lib/aliases.zsh # -- include aliases

# ==============================================
# -- init_path - setup all the required paths.
Expand Down Expand Up @@ -532,7 +536,7 @@ init_motd () {
sysfetch | _pipe_separate 2 | sed 's/^/ /'
echo ""

g_loading "System check on $MACHINE_OS"
_loading "System check on $MACHINE_OS"
zshbop_systemcheck
init_check_vm
echo ""
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.1
2.8.2
4 changes: 0 additions & 4 deletions zshbop.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,7 @@ STARTLOG
# ---------------
# -- Source files
# ---------------
source ${ZSHBOP_ROOT}/lib/colors.zsh # -- colors first!
source ${ZSHBOP_ROOT}/lib/functions-core.zsh #--
source ${ZSHBOP_ROOT}/lib/functions.zsh # --
source ${ZSHBOP_ROOT}/lib/init.zsh # -- include init
source ${ZSHBOP_ROOT}/lib/aliases.zsh # -- include functions
source ${ZSHBOP_ROOT}/lib/help.zsh # -- include help functions
source ${ZSHBOP_ROOT}/lib/kb.zsh # -- Built in Knolwedge Base

Expand Down

0 comments on commit b97ed6e

Please sign in to comment.