chore(cli): Better error handling
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
52e683e958
commit
9b0a64f90f
1 changed files with 4 additions and 1 deletions
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue