summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-26 18:19:11 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-26 18:19:11 +0200
commit138ce90bd5c87b10d35ab3b07629a9957d7fc59c (patch)
tree4665e6e3c07a0fdcc99d8453b98638dd510bc103
parentbd3ab6c267978993041a21917ecbb5ea53790e8a (diff)
downloadbin-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-xch4
1 files changed, 2 insertions, 2 deletions
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"
}