dev: move ascii art to bin/

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-08 22:32:05 +01:00
parent 4a9d1f0a29
commit 37e4539ef8
2 changed files with 9 additions and 7 deletions

View File

@ -16,7 +16,7 @@
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
# Usage: bashbot.sh [-h|--help|BOTCOMMANDS] # Usage: bashbot.sh [-h|--help|BOTCOMMANDS]
BOTCOMMANDS="start, stop, status, help, init, suspendback, resumeback, killback" BOTCOMMANDS="--help help init start stop status suspendback resumeback killback"
# #
# Exit Codes: # Exit Codes:
# 0 - success (hopefully) # 0 - success (hopefully)
@ -30,7 +30,7 @@
# 8 - curl/wget missing # 8 - curl/wget missing
# 10 - not bash! # 10 - not bash!
# #
#### $$VERSION$$ v1.25-dev-39-gbd2d2e1 #### $$VERSION$$ v1.25-dev-40-g4a9d1f0
################################################################## ##################################################################
# emmbeded system may claim bash but it is not # emmbeded system may claim bash but it is not
@ -167,9 +167,11 @@ RUNUSER="${USER}" # USER is overwritten by bashbot array :-(, save original
# provide help # provide help
case "$1" in case "$1" in
""|"-h"*) [ -z "${SOURCE}" ] && printf "${ORANGE}Available commands: ${GREY}${BOTCOMMANDS}${NN}" && exit "") [ -z "${SOURCE}" ] && printf "${ORANGE}Available commands: ${GREY}${BOTCOMMANDS}${NN}" && exit
;; ;;
"--h"*) sed -nE -e '/(NOT EDIT)|(shellcheck)/d' -e '3,/###/p' <"$0" "--h"*) LOGO="${BASHBOT_HOME:-.}/bin/bashbot.ascii"
[ -r "${LOGO}" ] && cat "${LOGO}"
sed -nE -e '/(NOT EDIT)|(shellcheck)/d' -e '3,/###/p' <"$0"
exit;; exit;;
"help") HELP="${BASHBOT_HOME:-.}/README" "help") HELP="${BASHBOT_HOME:-.}/README"
if [ -n "${INTERACTIVE}" ];then if [ -n "${INTERACTIVE}" ];then

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
#### $$VERSION$$ v1.25-dev-39-gbd2d2e1 #### $$VERSION$$ v1.25-dev-40-g4a9d1f0
# shellcheck disable=SC2016 # shellcheck disable=SC2016
# #
# Easy Versioning in git: # Easy Versioning in git:
@ -56,8 +56,8 @@ FILES="$(find ./*)"
if [[ "${FILES}" == *"README.md"* ]]; then if [[ "${FILES}" == *"README.md"* ]]; then
FILES+=" README.html README.txt" FILES+=" README.html README.txt"
type -f pandoc >/dev/null && pandoc -s -f commonmark -M "title=Bashbot README" README.md >README.html type -f pandoc >/dev/null && pandoc -s -f commonmark -M "title=Bashbot README" README.md >README.html
cat "dev/bashbot.ascii" >"README.txt" cat "bin/bashbot.ascii" >"README.txt"
if [ -f "README.html" ] && type -f html2text >/dev/null; then if [ -r "README.html" ] && type -f html2text >/dev/null; then
# convert html links to text [link] # convert html links to text [link]
sed -E 's/<a href="([^>]+)">([^<#]+)<\/a>/\2 [\1]/' <README.html |\ sed -E 's/<a href="([^>]+)">([^<#]+)<\/a>/\2 [\1]/' <README.html |\
html2text -style pretty -width 90 - >>README.txt html2text -style pretty -width 90 - >>README.txt