[LEDE-DEV] [patch master 05/15] Use cd ... || exit in case cd fails

Oswald Buddenhagen oswald.buddenhagen at gmx.de
Sat Oct 1 00:44:57 PDT 2016


On Fri, Sep 30, 2016 at 10:02:19PM +0200, Jan-Tarek Butt wrote:
> diff --git a/scripts/get_source_date_epoch.sh b/scripts/get_source_date_epoch.sh
> -[ -n "$TOPDIR" ] && cd "$TOPDIR"
> +[ -n "$TOPDIR" ] && cd "$TOPDIR" || exit
> diff --git a/scripts/getver.sh b/scripts/getver.sh
> -[ -n "$TOPDIR" ] && cd "$TOPDIR"
> +[ -n "$TOPDIR" ] && cd "$TOPDIR" || exit
>  
these two are plain broken, as the script would just exit if TOPDIR is
empty. you need to use braces.




More information about the Lede-dev mailing list