File tree Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 11# HISTORY
22
3+ - v20251115
4+ - added `fn_exists`
5+ - added `in_vmware`
6+ - fix `is_apt`, `is_dnf`, ...
7+ - improved `i386_amd64`
8+ - fix `which`
9+ - added `ask_yesno`, `ask_yesno_timeout` to more.sh
10+
311- v20250815
412 - improved detector for CD & SCRIPT
513 - improved simple-entry.sh
Original file line number Diff line number Diff line change 88#
99# bash.sh:
1010# Standard Template for bash/zsh developing.
11- # Version: v20250815
11+ # Version: v20251115
1212# License: MIT
1313# Site: https://github/hedzr/bash.sh
1414#
@@ -106,7 +106,7 @@ _my_main_do_sth() {
106106
107107# #######################################################
108108
109- # ### HZ Tail BEGIN #### v20250815 ####
109+ # ### HZ Tail BEGIN #### v20251115 ####
110110in_debug () { (( $DEBUG )) ; }
111111in_provisioning () { (( $PROVISIONING )) ; } # # return exit status as true if $PROVISIONING is not equal to 0
112112is_root () { [ " $( id -u) " = " 0" ]; }
@@ -733,7 +733,7 @@ main_do_sth() {
733733 fi
734734 (( ${HAS_END:- 0} )) && { debug_begin && echo -n ' Success!' && debug_end; } || return $res_ # { [ $# -eq 0 ] && :; }
735735}
736- BASH_SH_VERSION=v20250815
736+ BASH_SH_VERSION=v20251115
737737DEBUG=${DEBUG:- 0}
738738# trans_readlink() { DIR="${1%/*}" && (cd $DIR && pwd -P); }
739739# is_darwin && realpathx() { [[ $1 == /* ]] && echo "$1" || { DIR="${1%/*}" && DIR=$(cd $DIR && pwd -P) && echo "$DIR/$(basename $1)"; }; } || realpathx() { readlink -f $*; }
@@ -743,4 +743,4 @@ in_sourcing && {
743743if_vagrant && [ " $SCRIPT " == " /tmp/vagrant-shell" ] && { [ -d $CD /ops.d ] || CD=/vagrant/bin; }
744744[ -L " $SCRIPT " ] && debug linked script found && SCRIPT=$( realpathx " $SCRIPT " ) && CD=$( dirname " $SCRIPT " )
745745in_sourcing || main_do_sth " $@ "
746- # ### HZ Tail END #### v20250815 ####
746+ # ### HZ Tail END #### v20251115 ####
Original file line number Diff line number Diff line change 88#
99# bash.sh:
1010# Standard Template for bash/zsh developing.
11- # Version: v20250815
11+ # Version: v20251115
1212# License: MIT
1313# Site: https://github.com/hedzr/bash.sh
1414#
@@ -257,7 +257,7 @@ _bash_sh_load_env_files() {
257257
258258# #######################################################
259259
260- # ### HZ Tail BEGIN #### v20250815 ####
260+ # ### HZ Tail BEGIN #### v20251115 ####
261261in_debug () { (( $DEBUG )) ; }
262262in_provisioning () { (( $PROVISIONING )) ; } # # return exit status as true if $PROVISIONING is not equal to 0
263263is_root () { [ " $( id -u) " = " 0" ]; }
@@ -1351,7 +1351,7 @@ main_do_sth() {
13511351 # disabling this logic is still simple by defining HAS_END=1.
13521352 (( ${HAS_END:- 0} )) && { debug_begin && echo -n ' Success!' && debug_end; } || return $result_code # { [ $# -eq 0 ] && :; }
13531353}
1354- BASH_SH_VERSION=v20250815
1354+ BASH_SH_VERSION=v20251115
13551355DEBUG=${DEBUG:- 0}
13561356PROVISIONING=${PROVISIONING:- 0}
13571357SUDO=sudo && [ " $( id -u) " = " 0" ] && SUDO= || :
@@ -1382,4 +1382,4 @@ path_in_orb_host "$0" && : || { [ -L "$SCRIPT" ] && debug "$(safety "linked scri
13821382# CD=$(cd `dirname "$0"`;pwd)
13831383# It will open a sub-shell to print the folder name of the running shell-script.
13841384in_sourcing && _bash_sh_load_import_files || main_do_sth " $@ "
1385- # ### HZ Tail END #### v20250815 ####
1385+ # ### HZ Tail END #### v20251115 ####
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ tip() { printf "\e[0;38;2;133;133;133m>>> $@\e[0m\n"; }
3232wrn () { printf " \e[0;38;2;172;172;22m... [WARN] \e[0;38;2;11;11;11m$@ \e[0m\n" ; }
3333err () { printf " \e[0;33;1;133;133;133m>>> $@ \e[0m\n" 1>&2 ; }
3434fn_exists () { LC_ALL=C type $1 2> /dev/null | grep -qE ' (shell function)|(a function)' ; }
35- CD=" $( cd $( dirname " $0 " ) && pwd) " && BASH_SH_VERSION=v20250815 && DEBUG=${DEBUG:- 0} && PROVISIONING=${PROVISIONING:- 0}
35+ CD=" $( cd $( dirname " $0 " ) && pwd) " && BASH_SH_VERSION=v20251115 && DEBUG=${DEBUG:- 0} && PROVISIONING=${PROVISIONING:- 0}
3636SUDO=sudo && [ " $( id -u) " = " 0" ] && SUDO=
3737LS_OPT=" --color" && is_darwin && LS_OPT=" -G"
3838(( $# )) && {
You can’t perform that action at this time.
0 commit comments