diff --git a/cmds/cmds-file.zsh b/cmds/cmds-file.zsh new file mode 100644 index 00000000..7b57d94e --- /dev/null +++ b/cmds/cmds-file.zsh @@ -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 " + return 1 + fi + + diff -rq "$DIR1" "$DIR2" +} + + + diff --git a/cmds/cmds-git.zsh b/cmds/cmds-git.zsh index eb9100ed..b0a0febd 100644 --- a/cmds/cmds-git.zsh +++ b/cmds/cmds-git.zsh @@ -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 diff --git a/cmds/cmds-software.zsh b/cmds/cmds-software.zsh index 765334f1..78d0c8d2 100644 --- a/cmds/cmds-software.zsh +++ b/cmds/cmds-software.zsh @@ -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 -} \ No newline at end of file +} + +# -- 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 \ No newline at end of file diff --git a/lib/init.zsh b/lib/init.zsh index 5f8d234d..242809b7 100644 --- a/lib/init.zsh +++ b/lib/init.zsh @@ -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. @@ -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 "" diff --git a/version b/version index 96d77177..cae9add9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.8.1 \ No newline at end of file +2.8.2 \ No newline at end of file diff --git a/zshbop.zsh b/zshbop.zsh index 0cdd4326..ef8ae6c1 100755 --- a/zshbop.zsh +++ b/zshbop.zsh @@ -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