From 0bc330f5a52fdd31cda1b848e0d09dc7749343e9 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sun, 2 Jul 2017 04:05:20 +0000 Subject: [PATCH] Add function "task_run" --- build.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index ce14186..ddc64e6 100755 --- a/build.sh +++ b/build.sh @@ -54,6 +54,16 @@ EOF fi } +task_run() { + if [ -x "$1" ]; then + log_begin "$1" + + "$1" + + log_end "$1" + fi +} + run_sub_stage() { log "Begin ${SUB_STAGE_DIR}" pushd ${SUB_STAGE_DIR} > /dev/null @@ -90,11 +100,9 @@ run_sub_stage() { popd > /dev/null log "End ${SUB_STAGE_DIR}/${i}-patches" fi - if [ -x ${i}-run.sh ]; then - log "Begin ${SUB_STAGE_DIR}/${i}-run.sh" - ./${i}-run.sh - log "End ${SUB_STAGE_DIR}/${i}-run.sh" - fi + + task_run "$SUB_STAGE_DIR/$i-run.sh" + if [ -f ${i}-run-chroot.sh ]; then log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot.sh" on_chroot < ${i}-run-chroot.sh