|
@ -22,7 +22,6 @@ get_path() { ( |
|
|
return 1 |
|
|
return 1 |
|
|
) } |
|
|
) } |
|
|
|
|
|
|
|
|
ANSI_ESC=$'\e[' |
|
|
|
|
|
|
|
|
|
|
|
ansi_color() { |
|
|
ansi_color() { |
|
|
local choice="$1" |
|
|
local choice="$1" |
|
@ -35,22 +34,9 @@ ansi_color() { |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ "$choice" != "no" ]; then |
|
|
|
|
|
|
|
|
|
|
|
SET_COL_CHAR="${ANSI_ESC}${COL_CHAR}G" |
|
|
|
|
|
SET_COL_STATUS="${ANSI_ESC}${COL_STATUS}G" |
|
|
|
|
|
SET_COL_INFO="${ANSI_ESC}${COL_INFO}G" |
|
|
|
|
|
SET_COL_ELT="${ANSI_ESC}${COL_ELT}G" |
|
|
|
|
|
|
|
|
|
|
|
SET_BEGINCOL="${ANSI_ESC}0G" |
|
|
|
|
|
|
|
|
ANSI_ESC=$'\e[' |
|
|
|
|
|
|
|
|
UP="${ANSI_ESC}1A" |
|
|
|
|
|
DOWN="${ANSI_ESC}1B" |
|
|
|
|
|
LEFT="${ANSI_ESC}1D" |
|
|
|
|
|
RIGHT="${ANSI_ESC}1C" |
|
|
|
|
|
|
|
|
|
|
|
SAVE="${ANSI_ESC}7" |
|
|
|
|
|
RESTORE="${ANSI_ESC}8" |
|
|
|
|
|
|
|
|
if [ "$choice" != "no" ]; then |
|
|
|
|
|
|
|
|
NORMAL="${ANSI_ESC}0m" |
|
|
NORMAL="${ANSI_ESC}0m" |
|
|
|
|
|
|
|
@ -71,57 +57,14 @@ ansi_color() { |
|
|
DARKPINK="${ANSI_ESC}0;35m" |
|
|
DARKPINK="${ANSI_ESC}0;35m" |
|
|
DARKCYAN="${ANSI_ESC}0;36m" |
|
|
DARKCYAN="${ANSI_ESC}0;36m" |
|
|
DARKWHITE="${ANSI_ESC}0;37m" |
|
|
DARKWHITE="${ANSI_ESC}0;37m" |
|
|
|
|
|
|
|
|
SUCCESS=$GREEN |
|
|
|
|
|
WARNING=$YELLOW |
|
|
|
|
|
FAILURE=$RED |
|
|
|
|
|
NOOP=$BLUE |
|
|
|
|
|
ON=$SUCCESS |
|
|
|
|
|
OFF=$FAILURE |
|
|
|
|
|
ERROR=$FAILURE |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
|
|
SET_COL_CHAR= |
|
|
|
|
|
SET_COL_STATUS= |
|
|
|
|
|
SET_COL_INFO= |
|
|
|
|
|
SET_COL_ELT= |
|
|
|
|
|
|
|
|
|
|
|
SET_BEGINCOL= |
|
|
|
|
|
|
|
|
|
|
|
NORMAL= |
|
|
|
|
|
RED= |
|
|
|
|
|
GREEN= |
|
|
|
|
|
YELLOW= |
|
|
|
|
|
BLUE= |
|
|
|
|
|
GRAY= |
|
|
|
|
|
WHITE= |
|
|
|
|
|
|
|
|
|
|
|
DARKGRAY= |
|
|
|
|
|
DARKRED= |
|
|
|
|
|
DARKGREEN= |
|
|
|
|
|
DARKYELLOW= |
|
|
|
|
|
DARKBLUE= |
|
|
|
|
|
DARKPINK= |
|
|
|
|
|
DARKCYAN= |
|
|
|
|
|
|
|
|
|
|
|
SUCCESS= |
|
|
|
|
|
WARNING= |
|
|
|
|
|
FAILURE= |
|
|
|
|
|
NOOP= |
|
|
|
|
|
ON= |
|
|
|
|
|
OFF= |
|
|
|
|
|
ERROR= |
|
|
|
|
|
|
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
ansi_color="$choice" |
|
|
ansi_color="$choice" |
|
|
|
|
|
|
|
|
export SET_COL_CHAR SET_COL_STATUS SET_COL_INFO SET_COL_ELT \ |
|
|
|
|
|
SET_BEGINCOL UP DOWN LEFT RIGHT SAVE RESTORE NORMAL \ |
|
|
|
|
|
|
|
|
export NORMAL \ |
|
|
GRAY RED GREEN YELLOW BLUE PINK CYAN WHITE DARKGRAY \ |
|
|
GRAY RED GREEN YELLOW BLUE PINK CYAN WHITE DARKGRAY \ |
|
|
DARKRED DARKGREEN DARKYELLOW DARKBLUE DARKPINK DARKCYAN \ |
|
|
DARKRED DARKGREEN DARKYELLOW DARKBLUE DARKPINK DARKCYAN \ |
|
|
SUCCESS WARNING FAILURE NOOP ON OFF ERROR ansi_color |
|
|
|
|
|
|
|
|
ansi_color |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -175,8 +118,10 @@ OS=$(get_os) || { |
|
|
exit 1 |
|
|
exit 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn.exists() { declare -F "$1" >/dev/null; } |
|
|
fn.exists() { declare -F "$1" >/dev/null; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## copy stdin to file, archive previous existing file if any |
|
|
## copy stdin to file, archive previous existing file if any |
|
|
install_file() { |
|
|
install_file() { |
|
|
local path="$1" tmpfile |
|
|
local path="$1" tmpfile |
|
@ -203,6 +148,7 @@ install_file() { |
|
|
rm -f "$tmpfile" |
|
|
rm -f "$tmpfile" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_charm_store() { |
|
|
get_charm_store() { |
|
|
if ! [ -d "$CHARM_PATH" ]; then |
|
|
if ! [ -d "$CHARM_PATH" ]; then |
|
|
echo "Creating charm-store in '$CHARM_PATH'." |
|
|
echo "Creating charm-store in '$CHARM_PATH'." |
|
@ -337,7 +283,6 @@ install.wsl2() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run() { |
|
|
run() { |
|
|
OS="$(get_os)" |
|
|
OS="$(get_os)" |
|
|
if fn.exists "install.$OS"; then |
|
|
if fn.exists "install.$OS"; then |
|
@ -347,5 +292,11 @@ run() { |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## |
|
|
|
|
|
## Code |
|
|
|
|
|
## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ansi_color tty |
|
|
ansi_color tty |
|
|
run |
|
|
run |