Compare commits
7 commits
cc96c1cd81
...
c0d42e6208
Author | SHA1 | Date | |
---|---|---|---|
c0d42e6208 | |||
1c1813148b | |||
f3d5b5c464 | |||
9eb9e69934 | |||
55051830ac | |||
f4ee63aab7 | |||
6dcdf960c7 |
2 changed files with 46 additions and 16 deletions
|
@ -213,8 +213,8 @@ Handle project workflows in a unified way:
|
||||||
|
|
||||||
### Shell
|
### Shell
|
||||||
|
|
||||||
|
* banner with constants for characters
|
||||||
* comment
|
* comment
|
||||||
* fit banner to text
|
|
||||||
* review repositories handling for systems
|
* review repositories handling for systems
|
||||||
* opensuse
|
* opensuse
|
||||||
* codecs repository
|
* codecs repository
|
||||||
|
|
60
spcd/main.sh
60
spcd/main.sh
|
@ -828,10 +828,38 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
|
||||||
# functions
|
# functions
|
||||||
|
|
||||||
spcd_banner() {
|
spcd_banner() {
|
||||||
echo "\
|
unset SPCD_BANNER_1 SPCD_BANNER_2 SPCD_BANNER_3
|
||||||
${SPCD_DOWN}
|
spcd_banner_add_123 "${SPCD_DOWN}" "${SPCD_VERT}" "${SPCD___UP}"
|
||||||
${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() {
|
spcd_cat() {
|
||||||
|
@ -865,14 +893,20 @@ spcd_error_os() {
|
||||||
exit "${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() {
|
spcd_git_clone() {
|
||||||
if [ -n "${1}" ]; then
|
if [ -n "${1}" ]; then
|
||||||
spcd_gc__name="$(basename "${1}")"
|
spcd_gc__name="$(basename "${1}")"
|
||||||
spcd_gc__path="${SPCD_DL}/${spcd_gc__name}"
|
spcd_gc__path="${SPCD_DL}/${spcd_gc__name}"
|
||||||
spcd_gc__url="$(spcd_git_url "${1}")"
|
spcd_gc__url="$(spcd_git_url "${1}")"
|
||||||
git clone \
|
git clone "${spcd_gc__url}" "${spcd_gc__path}"
|
||||||
"${spcd_gc__url}" \
|
|
||||||
"${spcd_gc__path}"
|
|
||||||
echo "${spcd_gc__path}"
|
echo "${spcd_gc__path}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -985,18 +1019,14 @@ spcd_split() {
|
||||||
spcd_step() {
|
spcd_step() {
|
||||||
SPCD_STEP=$((SPCD_STEP + 1))
|
SPCD_STEP=$((SPCD_STEP + 1))
|
||||||
SPCD_STEP_TEXT="${*}"
|
SPCD_STEP_TEXT="${*}"
|
||||||
unset SPCD_SUBSTEP
|
unset SPCD_SUBSTEP SPCD_SUBSTEP_TEXT
|
||||||
spcd_banner "${SPCD_STEP}" "${SPCD_VERT}" "${SPCD_STEP_TEXT}"
|
spcd_banner
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_substep() {
|
spcd_substep() {
|
||||||
SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1))
|
SPCD_SUBSTEP=$((SPCD_SUBSTEP + 1))
|
||||||
spcd_banner \
|
SPCD_SUBSTEP_TEXT="${*}"
|
||||||
"${SPCD_STEP}.${SPCD_SUBSTEP}" \
|
spcd_banner
|
||||||
"${SPCD_VERT}" \
|
|
||||||
"${SPCD_STEP_TEXT}" \
|
|
||||||
"${SPCD_VERT}" \
|
|
||||||
"${*}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_write() {
|
spcd_write() {
|
||||||
|
|
Loading…
Reference in a new issue