Compare commits

..

7 commits

Author SHA1 Message Date
c0d42e6208
readme/banner
Some checks failed
/ job (push) Has been cancelled
2024-08-23 23:07:28 +02:00
1c1813148b
spcd_banner 2024-08-23 23:06:10 +02:00
f3d5b5c464
spcd_banner_add_123 2024-08-23 23:03:18 +02:00
9eb9e69934
spcd_banner_add 2024-08-23 22:48:07 +02:00
55051830ac
shellcheck 2024-08-23 22:44:21 +02:00
f4ee63aab7
git clone 2024-08-23 21:10:11 +02:00
6dcdf960c7
spcd_fill 2024-08-23 19:58:35 +02:00
2 changed files with 46 additions and 16 deletions

View file

@ -213,8 +213,8 @@ Handle project workflows in a unified way:
### Shell
* banner with constants for characters
* comment
* fit banner to text
* review repositories handling for systems
* opensuse
* codecs repository

View file

@ -828,10 +828,38 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
# functions
spcd_banner() {
echo "\
${SPCD_DOWN}
${SPCD_VERT} ${*}
${SPCD___UP}"
unset SPCD_BANNER_1 SPCD_BANNER_2 SPCD_BANNER_3
spcd_banner_add_123 "${SPCD_DOWN}" "${SPCD_VERT}" "${SPCD___UP}"
#
spcd_banner__index="${SPCD_STEP}"
[ -n "${SPCD_SUBSTEP}" ] &&
spcd_banner__index="${spcd_banner__index}.${SPCD_SUBSTEP}"
spcd_banner_add "${spcd_banner__index}"
#
for spcd_banner__item in "${SPCD_STEP_TEXT}" "${SPCD_SUBSTEP_TEXT}"; do
spcd_banner_add_123 "┬" "${SPCD_VERT}" "┴"
spcd_banner_add "${spcd_banner__item}"
done
#
spcd_banner_add_123 "╮" "${SPCD_VERT}" "╯"
}
spcd_banner_add() {
if [ -n "${1}" ]; then
spcd_ba__text=" ${1} "
spcd_ba__length=${#spcd_ba__text}
spcd_ba__filler="$(spcd_fill "${spcd_ba__length}")"
spcd_banner_add_123 \
"${spcd_ba__filler}" "${spcd_ba__text}" "${spcd_ba__filler}"
fi
}
spcd_banner_add_123() {
if [ -n "${3}" ]; then
SPCD_BANNER_1="${SPCD_BANNER_1}${1}"
SPCD_BANNER_2="${SPCD_BANNER_2}${2}"
SPCD_BANNER_3="${SPCD_BANNER_3}${3}"
fi
}
spcd_cat() {
@ -865,14 +893,20 @@ spcd_error_os() {
exit "${SPCD_ERROR_OS}"
}
spcd_fill() {
spcd_fill__index=${1}
while [ "${spcd_fill__index}" -gt 0 ]; do
printf "%s" "${2}"
spcd_fill__index=$((spcd_fill__index - 1))
done
}
spcd_git_clone() {
if [ -n "${1}" ]; then
spcd_gc__name="$(basename "${1}")"
spcd_gc__path="${SPCD_DL}/${spcd_gc__name}"
spcd_gc__url="$(spcd_git_url "${1}")"
git clone \
"${spcd_gc__url}" \
"${spcd_gc__path}"
git clone "${spcd_gc__url}" "${spcd_gc__path}"
echo "${spcd_gc__path}"
fi
}
@ -985,18 +1019,14 @@ spcd_split() {
spcd_step() {
SPCD_STEP=$((SPCD_STEP + 1))
SPCD_STEP_TEXT="${*}"
unset SPCD_SUBSTEP
spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}"
unset SPCD_SUBSTEP SPCD_SUBSTEP_TEXT
spcd_banner
}
spcd_substep() {
SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1))
spcd_banner \
"${SPCD_STEP}.${SPCD_SUBSTEP}" \
"${SPCD_VERT}" \
"${SPCD_STEP_TEXT}" \
"${SPCD_VERT}" \
"${*}"
SPCD_SUBSTEP_TEXT="${*}"
spcd_banner
}
spcd_write() {