[openwrt/openwrt] scripts/env: exit in case of failure to cd

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 11 09:54:49 EDT 2020


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f80a540dbf9bf87e15f0f29da7f4019064ee207d

commit f80a540dbf9bf87e15f0f29da7f4019064ee207d
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Jan 5 18:32:37 2020 -0800

    scripts/env: exit in case of failure to cd
    
    Found with shellcheck.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 scripts/env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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"
 }
 



More information about the lede-commits mailing list