chore(cli): Better error handling

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2023-01-27 17:03:38 +01:00
parent 52e683e958
commit 9b0a64f90f

View file

@ -33,7 +33,10 @@ function exists() {
}
function err_cd() {
cd "$1" &> /dev/null || (log err not able to cd to "$1" && exit 100)
if ! cd "$1" &> /dev/null ; then
log err not able to cd to "$1"
exit 100
fi
}
function log () {