Skip to content

Commit e297d48

Browse files
committed
fix: ensure that alias echo.Reset does not strip apostrophs
1 parent 99150cd commit e297d48

13 files changed

Lines changed: 18 additions & 7 deletions

File tree

β€Ždist/ColorEcho.bashβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,5 +2518,5 @@ function echo.Rainbow() {
25182518
if command -v lolcat > /dev/null 2>&1; then echo "$*" | lolcat; else echo "$*"; fi
25192519
}
25202520
function echo.Reset() {
2521-
echo "$*" | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g" | xargs
2521+
echo $* | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g"; echo
25222522
}

β€Ždist/ColorEcho.fishβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,5 +2518,5 @@ function echo.Rainbow
25182518
if command -v lolcat > /dev/null; echo "$argv" | lolcat; else; echo "$argv"; end
25192519
end
25202520
function echo.Reset
2521-
echo "$argv" | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g" | xargs
2521+
echo $argv | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g"; echo
25222522
end

β€Ždist/ColorEcho.kshβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,5 +2518,5 @@ function echoRainbow {
25182518
if command -v lolcat 2> /dev/null >&2; then echo "$*" | lolcat; else echo "$*"; fi
25192519
}
25202520
function echoReset {
2521-
echo "$*" | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g" | xargs
2521+
echo $* | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g"; echo
25222522
}

β€Ždist/ColorEcho.shβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2525,5 +2525,5 @@ echoRainbow() {
25252525
if command -v lolcat > /dev/null 2>&1; then echo "$*" | lolcat; else echo "$*"; fi
25262526
}
25272527
echoReset() {
2528-
echo "$*" | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g" | xargs
2528+
echo $* | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g"; echo
25292529
}

β€Ždist/ColorEcho.tcshβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,4 +1267,4 @@ alias echo.LightSTULBrown 'echo "\033[9;4;9;38;5;52m\!*\033[m"'
12671267

12681268
alias echo.LightSTBLBrown 'echo "\033[9;5;9;38;5;52m\!*\033[m"'
12691269
alias echo.Rainbow 'which lolcat >& /dev/null && echo "\!*" | lolcat || echo "\!*"'
1270-
alias echo.Reset 'echo "\!*" | tr -d \[:cntrl:\] | sed -E "s/\[((;)?[0-9]{1,3}){0,3}m//g" | xargs'
1270+
alias echo.Reset 'echo \!* | tr -d \[:cntrl:\] | sed -E "s/\[((;)?[0-9]{1,3}){0,3}m//g"; echo'

β€Ždist/ColorEcho.zshβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,5 +2518,5 @@ function echo.Rainbow() {
25182518
if command -v lolcat > /dev/null 2>&1; then echo "$*" | lolcat; else echo "$*"; fi
25192519
}
25202520
function echo.Reset() {
2521-
echo "$*" | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g" | xargs
2521+
echo $* | tr -d '[:cntrl:]' | sed -E "s/\\[((;)?[0-9]{1,3}){0,3}m//g"; echo
25222522
}

β€Žgenerator.shβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ LOLCAT
238238
# echo.Reset to remove color code on output
239239
fnName="${fn}echo${dot}Reset${brackets}"
240240
cat << RESET >> "${tempDist}"
241-
${fnName}${startSym}echo "${para}" | tr -d ${trCntrl} | sed -E "s/${escape}[((;)?[0-9]{1,3}){0,3}m//g" | xargs${endSym}
241+
${fnName}${startSym}echo ${para} | tr -d ${trCntrl} | sed -E "s/${escape}[((;)?[0-9]{1,3}){0,3}m//g"; echo${endSym}
242242
RESET
243243
mv -f "${tempDist}" "${newDist}"
244244
} &

β€Žtest-scripts/bashβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ script="${dir}/../dist/ColorEcho.bash"
88
awk '/^function +echo/ {print $2}' "${script}" | sed 's/()//g' | while IFS= read -r x; do
99
${x} "${x}"
1010
done
11+
12+
echo.Reset "$( echo.Red "Red and \033[32m'green'" )"

β€Žtest-scripts/fishβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ set script "$dir/../dist/ColorEcho.fish"
77
for x in (awk '/^function +echo/ {print $2}' "$script")
88
eval $x "$x"
99
end
10+
11+
echo.Reset "$( echo.Red "Red and \033[32m'green'" )"

β€Žtest-scripts/kshβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ awk '/^function +echo/ {print $2}' "${script}" | while IFS= read -r x
99
do
1010
${x} "${x}"
1111
done
12+
13+
echoReset "$( echoRed "Red and \033[32m'green'" )"

0 commit comments

Comments
Β (0)