Skip to content

Commit d5378be

Browse files
Fix macOS(Darwin) sh support
1 parent a7b535f commit d5378be

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

β€Žgenerator.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for shell in sh bash fish ksh zsh; do
3737
"bash" | "zsh")
3838
fn='function '
3939
dot='.'
40-
echo='echo'
40+
echo='echo -e'
4141
startSym=' {'
4242
endSym='}'
4343
endIf='fi'
@@ -47,7 +47,7 @@ for shell in sh bash fish ksh zsh; do
4747
"ksh")
4848
fn='function '
4949
dot=
50-
echo='/bin/echo'
50+
echo='/bin/echo -e'
5151
startSym=' {'
5252
endSym='}'
5353
endIf='fi'
@@ -57,7 +57,7 @@ for shell in sh bash fish ksh zsh; do
5757
"fish")
5858
fn='function '
5959
dot='.'
60-
echo='echo'
60+
echo='echo -e'
6161
startSym=
6262
endSym='end'
6363
endIf='end'
@@ -88,9 +88,11 @@ for shell in sh bash fish ksh zsh; do
8888
if [ "${shell}" = "sh" ]; then
8989
cat << SH_ECHO >> "${newDist}"
9090
if [ "\$(uname)" = "FreeBSD" ]; then
91+
ECHO="echo -e"
92+
elif [ "\$(uname)" = "Darwin" ]; then
9193
ECHO="echo"
9294
else
93-
ECHO="/bin/echo"
95+
ECHO="/bin/echo -e"
9496
fi
9597
SH_ECHO
9698
fi
@@ -121,7 +123,7 @@ SH_ECHO
121123
fi
122124
#write the code down
123125
echo "${startSym}"
124-
echo " ${echo}"' -e "\033['"${ulCode}${bCode}${code}""$(grep "${color}" "${table}" | awk '{print $2}')"'m$'"${para}"'\033[m"'
126+
echo " ${echo}"' "\033['"${ulCode}${bCode}${code}""$(grep "${color}" "${table}" | awk '{print $2}')"'m$'"${para}"'\033[m"'
125127
echo "${endSym}"
126128
} >> "${newDist}"
127129
done

0 commit comments

Comments
Β (0)