[OpenWrt-Devel,3/4] scripts/env: exit in case of failure to cd
diff mbox series

Message ID 20200106023238.170677-3-rosenp@gmail.com
State New
Headers show
Series
  • [OpenWrt-Devel,1/4] scripts/env: use command -v instead of which
Related show

Commit Message

Rosen Penev Jan. 6, 2020, 2:32 a.m. UTC
Found with shellcheck.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 scripts/env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/scripts/env b/scripts/env
index 19cfa13841..848850a778 100755
--- a/scripts/env
+++ b/scripts/env
@@ -147,7 +147,7 @@  env_clear() {
 	else
 		rm -rf "$BASEDIR/files" "$BASEDIR/.config"
 	fi
-	cd "$BASEDIR"
+	cd "$BASEDIR" || exit 1
 	rm -rf "$ENVDIR"
 }