summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-29 09:50:17 +0200
committerViljami Ilola <+@hix.fi>2024-03-29 09:50:17 +0200
commit4e88912ff032f1df77480ba37c82fb7049d1ff1b (patch)
treed7f39e1699c358ff5b006437d4a849ca105cf2d3
parent9e60c8dd2a3c8d27d02d1e7a019c55f23c6831c6 (diff)
echo in dev.sh
-rwxr-xr-xdev.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/dev.sh b/dev.sh
index c1fafd2..75f756a 100755
--- a/dev.sh
+++ b/dev.sh
@@ -1,6 +1,8 @@
#!/bin/sh
-[ x$1 = x ] && echo "\
+ECHO="`which echo` -e"
+
+[ x$1 = x ] && $ECHO "\
Small script for running developement tools.
Usage: $0 <command>
@@ -20,13 +22,13 @@ install Build poetry package and install it for current user
PIP=`which pipx`
[ x$PIP = x ] && PIP=`which pip`
[ x$PIP = x ] \
- && echo "This scripts needs pipx or pip to install dependencies." \
+ && $ECHO "This scripts needs pipx or pip to install dependencies." \
&& exit 1
export DEVSH_PRIN=">>$DEVSH_PRIN"
export DEVSH_PROUT="<<$DEVSH_PROUT"
-echo "\033[32m$DEVSH_PRIN $0 $1 - started.\033[0m"
+$ECHO "\033[32m$DEVSH_PRIN $0 $1 - started.\033[0m"
case $1 in
@@ -36,7 +38,7 @@ case $1 in
install-latest-build)
$PIP install `ls dist/*.tar.gz -t -c -1 | head -1` \
- && echo "For uninstall please use '$PIP uninstall ...'"
+ && $ECHO "For uninstall please use '$PIP uninstall ...'"
;;
poetry-dev-deps)
@@ -91,7 +93,7 @@ case $1 in
;;
*)
- echo "\033[31m$DEVSH_PROUT $0 $1 - unknown command.\033[0m"
+ $ECHO "\033[31m$DEVSH_PROUT $0 $1 - unknown command.\033[0m"
exit 1
;;
esac
@@ -99,7 +101,7 @@ esac
STATUS=$?
[ $STATUS != 0 ] \
- && echo "\033[31m$DEVSH_PROUT $0 $1 - exited with code $STATUS.\033[0m" \
+ && $ECHO "\033[31m$DEVSH_PROUT $0 $1 - exited with code $STATUS.\033[0m" \
&& exit $STATUS
-echo "\033[32m$DEVSH_PROUT $0 $1 - done.\033[0m"
+$ECHO "\033[32m$DEVSH_PROUT $0 $1 - done.\033[0m"