Compare commits
2 commits
937ed5e1f1
...
d7142f2b1d
Author | SHA1 | Date | |
---|---|---|---|
d7142f2b1d | |||
03829cc4b4 |
2 changed files with 59 additions and 58 deletions
|
@ -285,6 +285,7 @@ Handle project workflows in a unified way:
|
|||
* automate versions fetching
|
||||
* gource, xvfb, xauth
|
||||
* handle openh264 repositories
|
||||
* rpm fusion
|
||||
* tex
|
||||
* translate to french
|
||||
* try to support nix
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
# │ __ = internal │
|
||||
# ╰───────────────╯
|
||||
|
||||
# __SPCD_BANNER_TOP
|
||||
# __SPCD_BANNER_MIDDLE
|
||||
# __SPCD_BANNER_BOTTOM
|
||||
# __SPCD_BAR_TOP
|
||||
# __SPCD_BAR_MIDDLE
|
||||
# __SPCD_BAR_BOTTOM
|
||||
|
||||
# __SPCD_STEP_LEVEL
|
||||
# __SPCD_STEP_level_INDEX
|
||||
|
@ -36,35 +36,35 @@ _spcd_fill() {
|
|||
done
|
||||
}
|
||||
|
||||
# ╭───┬────────╮
|
||||
# │ _ │ banner │
|
||||
# ╰───┴────────╯
|
||||
# ╭───┬─────╮
|
||||
# │ _ │ bar │
|
||||
# ╰───┴─────╯
|
||||
|
||||
_SPCD_BANNER_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}"
|
||||
_SPCD_BANNER_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}"
|
||||
_SPCD_BANNER_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}"
|
||||
_SPCD_BANNER_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}"
|
||||
_SPCD_BANNER_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}"
|
||||
_SPCD_BANNER_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}"
|
||||
_SPCD_BANNER_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}"
|
||||
_SPCD_BANNER_VERTICAL="${_SPCD_BOX_VERTICAL}"
|
||||
_SPCD_BAR_BOTTOM_LEFT="${_SPCD_BOX_UP_AND_RIGHT}"
|
||||
_SPCD_BAR_BOTTOM_MIDDLE="${_SPCD_BOX_UP_AND_HORIZONTAL}"
|
||||
_SPCD_BAR_BOTTOM_RIGHT="${_SPCD_BOX_UP_AND_LEFT}"
|
||||
_SPCD_BAR_HORIZONTAL="${_SPCD_BOX_HORIZONTAL}"
|
||||
_SPCD_BAR_TOP_LEFT="${_SPCD_BOX_DOWN_AND_RIGHT}"
|
||||
_SPCD_BAR_TOP_MIDDLE="${_SPCD_BOX_DOWN_AND_HORIZONTAL}"
|
||||
_SPCD_BAR_TOP_RIGHT="${_SPCD_BOX_DOWN_AND_LEFT}"
|
||||
_SPCD_BAR_VERTICAL="${_SPCD_BOX_VERTICAL}"
|
||||
|
||||
_spcd_banner_add() {
|
||||
_spcd_bar_add() {
|
||||
if [ -n "${1}" ]; then
|
||||
local text length filler
|
||||
text=" ${1} "
|
||||
length=${#text}
|
||||
filler="$(_spcd_fill "${length}" "${_SPCD_BANNER_HORIZONTAL}")"
|
||||
if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then
|
||||
_spcd_banner_split
|
||||
filler="$(_spcd_fill "${length}" "${_SPCD_BAR_HORIZONTAL}")"
|
||||
if [ -n "${__SPCD_BAR_MIDDLE}" ]; then
|
||||
_spcd_bar_split
|
||||
else
|
||||
_spcd_banner_open
|
||||
_spcd_bar_open
|
||||
fi
|
||||
_spcd_banner_append "${filler}" "${text}" "${filler}"
|
||||
_spcd_bar_append "${filler}" "${text}" "${filler}"
|
||||
fi
|
||||
}
|
||||
|
||||
_spcd_banner_add_index() {
|
||||
_spcd_bar_add_index() {
|
||||
local level value label
|
||||
while true; do
|
||||
level=$((level + 1))
|
||||
|
@ -76,68 +76,68 @@ _spcd_banner_add_index() {
|
|||
label="${value}"
|
||||
fi
|
||||
done
|
||||
_spcd_banner_add "${label}"
|
||||
_spcd_bar_add "${label}"
|
||||
}
|
||||
|
||||
_spcd_banner_append() {
|
||||
_spcd_bar_append() {
|
||||
if [ -n "${3}" ]; then
|
||||
__SPCD_BANNER_TOP="${__SPCD_BANNER_TOP}${1}"
|
||||
__SPCD_BANNER_MIDDLE="${__SPCD_BANNER_MIDDLE}${2}"
|
||||
__SPCD_BANNER_BOTTOM="${__SPCD_BANNER_BOTTOM}${3}"
|
||||
__SPCD_BAR_TOP="${__SPCD_BAR_TOP}${1}"
|
||||
__SPCD_BAR_MIDDLE="${__SPCD_BAR_MIDDLE}${2}"
|
||||
__SPCD_BAR_BOTTOM="${__SPCD_BAR_BOTTOM}${3}"
|
||||
fi
|
||||
}
|
||||
|
||||
_spcd_banner_echo() {
|
||||
_spcd_bar_echo() {
|
||||
echo "\
|
||||
${__SPCD_BANNER_TOP}
|
||||
${__SPCD_BANNER_MIDDLE}
|
||||
${__SPCD_BANNER_BOTTOM}"
|
||||
${__SPCD_BAR_TOP}
|
||||
${__SPCD_BAR_MIDDLE}
|
||||
${__SPCD_BAR_BOTTOM}"
|
||||
}
|
||||
|
||||
_spcd_banner_open() {
|
||||
_spcd_banner_append \
|
||||
"${_SPCD_BANNER_TOP_LEFT}" \
|
||||
"${_SPCD_BANNER_VERTICAL}" \
|
||||
"${_SPCD_BANNER_BOTTOM_LEFT}"
|
||||
_spcd_bar_open() {
|
||||
_spcd_bar_append \
|
||||
"${_SPCD_BAR_TOP_LEFT}" \
|
||||
"${_SPCD_BAR_VERTICAL}" \
|
||||
"${_SPCD_BAR_BOTTOM_LEFT}"
|
||||
}
|
||||
|
||||
_spcd_banner_render() {
|
||||
_spcd_banner_wipe
|
||||
_spcd_banner_add "S"
|
||||
_spcd_banner_add_index
|
||||
_spcd_bar_render() {
|
||||
_spcd_bar_wipe
|
||||
_spcd_bar_add "S"
|
||||
_spcd_bar_add_index
|
||||
#
|
||||
local level value
|
||||
while true; do
|
||||
level=$((level + 1))
|
||||
eval "value=\"\${__SPCD_STEP_${level}_LABEL}\""
|
||||
[ -n "${value}" ] || break
|
||||
_spcd_banner_add "${value}"
|
||||
_spcd_bar_add "${value}"
|
||||
done
|
||||
#
|
||||
_spcd_banner_shut
|
||||
_spcd_banner_echo
|
||||
_spcd_banner_wipe
|
||||
_spcd_bar_shut
|
||||
_spcd_bar_echo
|
||||
_spcd_bar_wipe
|
||||
}
|
||||
|
||||
_spcd_banner_shut() {
|
||||
_spcd_banner_append \
|
||||
"${_SPCD_BANNER_TOP_RIGHT}" \
|
||||
"${_SPCD_BANNER_VERTICAL}" \
|
||||
"${_SPCD_BANNER_BOTTOM_RIGHT}"
|
||||
_spcd_bar_shut() {
|
||||
_spcd_bar_append \
|
||||
"${_SPCD_BAR_TOP_RIGHT}" \
|
||||
"${_SPCD_BAR_VERTICAL}" \
|
||||
"${_SPCD_BAR_BOTTOM_RIGHT}"
|
||||
}
|
||||
|
||||
_spcd_banner_split() {
|
||||
_spcd_banner_append \
|
||||
"${_SPCD_BANNER_TOP_MIDDLE}" \
|
||||
"${_SPCD_BANNER_VERTICAL}" \
|
||||
"${_SPCD_BANNER_BOTTOM_MIDDLE}"
|
||||
_spcd_bar_split() {
|
||||
_spcd_bar_append \
|
||||
"${_SPCD_BAR_TOP_MIDDLE}" \
|
||||
"${_SPCD_BAR_VERTICAL}" \
|
||||
"${_SPCD_BAR_BOTTOM_MIDDLE}"
|
||||
}
|
||||
|
||||
_spcd_banner_wipe() {
|
||||
_spcd_bar_wipe() {
|
||||
unset \
|
||||
__SPCD_BANNER_TOP \
|
||||
__SPCD_BANNER_MIDDLE \
|
||||
__SPCD_BANNER_BOTTOM
|
||||
__SPCD_BAR_TOP \
|
||||
__SPCD_BAR_MIDDLE \
|
||||
__SPCD_BAR_BOTTOM
|
||||
}
|
||||
|
||||
# ╭───┬───────╮
|
||||
|
@ -320,7 +320,7 @@ spcd_step() {
|
|||
local index="${prefix}_INDEX"
|
||||
eval "${index}=\$((${index} + 1))"
|
||||
eval "${prefix}_LABEL=\"${1}\""
|
||||
_spcd_banner_render
|
||||
_spcd_bar_render
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue