This commit is contained in:
Bishoy Ehab
2025-10-19 00:07:54 +03:00
parent 69b92b57aa
commit b23bdb0188
3 changed files with 20 additions and 15 deletions
+3 -4
View File
@@ -62,7 +62,7 @@ function x(){
function showfun(){
echo -e "${STY_BLUE}[$0]: The definition of function \"$1\" is as follows:${STY_RST}"
printf "${STY_GREEN}"
type -a $1
type -a "$1" 2>/dev/null || type -a "$1".sh 2>/dev/null || return 1
printf "${STY_RST}"
}
function pause(){
@@ -73,8 +73,7 @@ function pause(){
fi
}
function remove_bashcomments_emptylines(){
mkdir -p $(dirname $2)
cat $1 | sed -e '/^[[:blank:]]*#/d;s/#.*//' -e '/^[[:space:]]*$/d' > $2
mkdir -p "$(dirname "$2")" && cat "$1" | sed -e 's/#.*//' -e '/^[[:space:]]*$/d' > "$2"
}
function prevent_sudo_or_root(){
case $(whoami) in
@@ -95,7 +94,7 @@ function latest_commit_timestamp(){
echo "[latest_commit_timestamp] The timestamp of \"$target_path\" is empty. Aborting..." >&2
return 1
fi
echo $result
echo "$result"
}
function log_info() {