forked from Shinonome/dots-hyprland
Update diagnose
This commit is contained in:
@@ -17,9 +17,9 @@ case $(whoami) in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
x() { ii_exec "$@" 2>&1 | tee -a $output_file ; }
|
x() { _exec "$@" 2>&1 | tee -a $output_file ; }
|
||||||
e() { ii_box "$@" | tee -a $output_file ; }
|
e() { _box "$@" | tee -a $output_file ; }
|
||||||
ii_box() {
|
_box() {
|
||||||
length=$(echo "$1" | wc -L);total_width=$((length + 2))
|
length=$(echo "$1" | wc -L);total_width=$((length + 2))
|
||||||
#line=$(printf "═%.0s" $(seq 1 $total_width))
|
#line=$(printf "═%.0s" $(seq 1 $total_width))
|
||||||
#border_up="╔${line}╗";border_down="╚${line}╝"
|
#border_up="╔${line}╗";border_down="╚${line}╝"
|
||||||
@@ -31,7 +31,7 @@ ii_box() {
|
|||||||
echo "$border_vertical $1 $border_vertical"
|
echo "$border_vertical $1 $border_vertical"
|
||||||
echo "$border_down"
|
echo "$border_down"
|
||||||
}
|
}
|
||||||
ii_exec() {
|
_exec() {
|
||||||
printf "\n[===diagnose===] $*\n"
|
printf "\n[===diagnose===] $*\n"
|
||||||
"$@"
|
"$@"
|
||||||
err=$?;if [ ! $err -eq 0 ];then echo "[---EXIT $err---]";else echo "[---SUCCESS---]";fi
|
err=$?;if [ ! $err -eq 0 ];then echo "[---EXIT $err---]";else echo "[---SUCCESS---]";fi
|
||||||
|
|||||||
Reference in New Issue
Block a user