From 68f1bde1714e9f9c20f9d5f8b9cd2b0d21cef166 Mon Sep 17 00:00:00 2001 From: Rick van der Staaij Date: Wed, 6 Nov 2024 22:37:13 +0100 Subject: [PATCH] Fix some string coversion issues --- .../Generator/GeneredTaskfile/custom-section.sh | 2 +- .../Generator/GeneredTaskfile/taskfile-base.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Generator/GeneredTaskfile/custom-section.sh b/src/components/Generator/GeneredTaskfile/custom-section.sh index 639e3a4..4ba726e 100644 --- a/src/components/Generator/GeneredTaskfile/custom-section.sh +++ b/src/components/Generator/GeneredTaskfile/custom-section.sh @@ -4,5 +4,5 @@ function task:custom { ## This is a custom task definition title "Custom function" - echo -e "${YELLOW}"Add your custom sections here${RESET}"; + echo -e "${YELLOW}Add your custom sections here${RESET}"; } diff --git a/src/components/Generator/GeneredTaskfile/taskfile-base.sh b/src/components/Generator/GeneredTaskfile/taskfile-base.sh index f100595..450acef 100644 --- a/src/components/Generator/GeneredTaskfile/taskfile-base.sh +++ b/src/components/Generator/GeneredTaskfile/taskfile-base.sh @@ -49,16 +49,16 @@ RESET=$(printf '\\033[0m') [[globals]] function title { - echo -e "\\n\${BLUE}=>\${RESET} $1\\n" + echo -e "\n${BLUE}=>${RESET} $1\n" } function task:help { ## Show all available tasks title "Available tasks" - awk 'BEGIN {FS = " { [#][#][ ]?"} /^([a-zA-Z_-]*:?.*)(\\{ )?[#][#][ ]?/ \\ - {printf "\\033[33m%-34s\\033[0m %s\\n", $1, $2}' $0 |\\ - sed -E "s/[#]{2,}[ ]*/\${RESET}/g" |\\ + awk 'BEGIN {FS = " { [#][#][ ]?"} /^([a-zA-Z_-]*:?.*)(\{ )?[#][#][ ]?/ \ + {printf "\033[33m%-34s\033[0m %s\n", $1, $2}' $0 |\ + sed -E "s/[#]{2,}[ ]*/${RESET}/g" |\ sed -E "s/function task:*/ /g" - echo -e "\\n\${BLUE}Usage:\${RESET} $0 \${YELLOW}\${RESET} " + echo -e "\n${BLUE}Usage:${RESET} $0 ${YELLOW}${RESET} " } function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile @@ -71,7 +71,7 @@ function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile sudo curl --location --silent --output /usr/local/bin/task https://enri.se/taskfile-bin sudo chmod +x /usr/local/bin/task fi - echo -e "\${BLUE}You can now use:\${RESET} task \${YELLOW}\${RESET} " + echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}${RESET} " } banner