From 138ce90bd5c87b10d35ab3b07629a9957d7fc59c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 26 Aug 2016 18:19:11 +0200 Subject: ch: Return early on error Fixes an issue with gzip waiting forever when there are no files to be compressed and mv throwing an error. Signed-off-by: Florian Pritz --- ch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ch') diff --git a/ch b/ch index b068b48..939087f 100755 --- a/ch +++ b/ch @@ -99,7 +99,7 @@ __chrootalias_resolve_create() { __cleanup_logs() { mkdir -p "$1/logs" - mv "$1/"*.log "$1/"*.log.* "$1/logs/" + mv "$1/"*.log "$1/"*.log.* "$1/logs/" || return gzip -f "$1/logs/"*.log "$1/logs/"*.log.{1,2,3,4,5,6,7,8,9} } @@ -126,7 +126,7 @@ chshell() { chbuild() { __chrootalias_resolve_create "$1" || return - linux${chroot_arch} sudo makechrootpkg -l "${copydir##*/}" -r "$chrootdir" -n -- -f "${@:2}" + linux${chroot_arch} sudo makechrootpkg -l "${copydir##*/}" -r "$chrootdir" -n -- -f "${@:2}" || return chshell "$1" pacman --noconfirm -Rcs namcap __cleanup_logs "$PWD" } -- cgit v1.2.3-24-g4f1b