diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-08-26 18:19:11 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-08-26 18:19:11 +0200 |
commit | 138ce90bd5c87b10d35ab3b07629a9957d7fc59c (patch) | |
tree | 4665e6e3c07a0fdcc99d8453b98638dd510bc103 | |
parent | bd3ab6c267978993041a21917ecbb5ea53790e8a (diff) | |
download | bin-138ce90bd5c87b10d35ab3b07629a9957d7fc59c.tar.gz bin-138ce90bd5c87b10d35ab3b07629a9957d7fc59c.tar.xz |
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 <bluewind@xinu.at>
-rwxr-xr-x | ch | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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" } |