Skip to content

Commit 9412c16

Browse files
committed
v20250711
1 parent 6d2c614 commit 9412c16

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# HISTORY
22

3+
- v20250711
4+
- fix bump()
5+
- added SUDO prefix
6+
- add which func if not exists
7+
- protected false branches
8+
- added is_rocky
9+
- sometimes id_like might be 'rhel centos fedora'
10+
- hostnamectl may need sudo permission
11+
- fix `sleepx()`
12+
-
13+
314
- v20250616
415
- improved detector of `$CD` in orb vm
516
- improved `debug_info`

bash-lite.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# bash.sh:
1010
# Standard Template for bash/zsh developing.
11-
# Version: v20250616
11+
# Version: v20250711
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 #### v20250616 ####
109+
#### HZ Tail BEGIN #### v20250711 ####
110110
in_debug() { (($DEBUG)); }
111111
in_provisioning() { (($PROVISIONING)); } ## return exit status as true if $PROVISIONING is not equal to 0
112112
is_root() { [ "$(id -u)" = "0" ]; }
@@ -724,7 +724,7 @@ main_do_sth() {
724724
fi
725725
((${HAS_END:-0})) && { debug_begin && echo -n 'Success!' && debug_end; } || return $res_ # { [ $# -eq 0 ] && :; }
726726
}
727-
BASH_SH_VERSION=v20250616
727+
BASH_SH_VERSION=v20250711
728728
DEBUG=${DEBUG:-0}
729729
# trans_readlink() { DIR="${1%/*}" && (cd $DIR && pwd -P); }
730730
# is_darwin && realpathx() { [[ $1 == /* ]] && echo "$1" || { DIR="${1%/*}" && DIR=$(cd $DIR && pwd -P) && echo "$DIR/$(basename $1)"; }; } || realpathx() { readlink -f $*; }
@@ -734,4 +734,4 @@ in_sourcing && {
734734
if_vagrant && [ "$SCRIPT" == "/tmp/vagrant-shell" ] && { [ -d $CD/ops.d ] || CD=/vagrant/bin; }
735735
[ -L "$SCRIPT" ] && debug linked script found && SCRIPT=$(realpathx "$SCRIPT") && CD=$(dirname "$SCRIPT")
736736
in_sourcing || main_do_sth "$@"
737-
#### HZ Tail END #### v20250616 ####
737+
#### HZ Tail END #### v20250711 ####

bash.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# bash.sh:
1010
# Standard Template for bash/zsh developing.
11-
# Version: v20250616
11+
# Version: v20250711
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 #### v20250616 ####
260+
#### HZ Tail BEGIN #### v20250711 ####
261261
in_debug() { (($DEBUG)); }
262262
in_provisioning() { (($PROVISIONING)); } ## return exit status as true if $PROVISIONING is not equal to 0
263263
is_root() { [ "$(id -u)" = "0" ]; }
@@ -1238,7 +1238,7 @@ main_do_sth() {
12381238
# disabling this logic is still simple by defining HAS_END=1.
12391239
((${HAS_END:-0})) && { debug_begin && echo -n 'Success!' && debug_end; } || return $result_code # { [ $# -eq 0 ] && :; }
12401240
}
1241-
BASH_SH_VERSION=v20250616
1241+
BASH_SH_VERSION=v20250711
12421242
DEBUG=${DEBUG:-0}
12431243
PROVISIONING=${PROVISIONING:-0}
12441244
SUDO=sudo && [ "$(id -u)" = "0" ] && SUDO=
@@ -1268,4 +1268,4 @@ path_in_orb_host "$0" && : || { [ -L "$SCRIPT" ] && debug "$(safety "linked scri
12681268
# CD=$(cd `dirname "$0"`;pwd)
12691269
# It will open a sub-shell to print the folder name of the running shell-script.
12701270
in_sourcing && _bash_sh_load_import_files || main_do_sth "$@"
1271-
#### HZ Tail END #### v20250616 ####
1271+
#### HZ Tail END #### v20250711 ####

simple-entry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dbg() { ((DEBUG)) && printf ">>> \e[0;38;2;133;133;133m$@\e[0m\n" || :; }
1414
tip() { printf "\e[0;38;2;133;133;133m>>> $@\e[0m\n"; }
1515
err() { printf "\e[0;33;1;133;133;133m>>> $@\e[0m\n" 1>&2; }
1616
fn_exists() { LC_ALL=C type $1 2>/dev/null | grep -qE '(shell function)|(a function)'; }
17-
CD="$(cd $(dirname "$0") && pwd)" && BASH_SH_VERSION=v20250616 && DEBUG=${DEBUG:-0} && PROVISIONING=${PROVISIONING:-0}
17+
CD="$(cd $(dirname "$0") && pwd)" && BASH_SH_VERSION=v20250711 && DEBUG=${DEBUG:-0} && PROVISIONING=${PROVISIONING:-0}
1818
(($#)) && {
1919
dbg "$# arg(s) | CD = $CD"
2020
check_entry() {

0 commit comments

Comments
 (0)