Skip to content

Commit

Permalink
Fix some string coversion issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-nu committed Nov 6, 2024
1 parent 52d3aff commit 68f1bde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Generator/GeneredTaskfile/custom-section.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
12 changes: 6 additions & 6 deletions src/components/Generator/GeneredTaskfile/taskfile-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}<task>\${RESET} <args>"
echo -e "\n${BLUE}Usage:${RESET} $0 ${YELLOW}<task>${RESET} <args>"
}

function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile
Expand All @@ -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}<task>\${RESET} <args>"
echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}<task>${RESET} <args>"
}

banner
Expand Down

0 comments on commit 68f1bde

Please sign in to comment.