From 98fa5b7665e78a736c3e80ac211fbf5b5959d686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Tue, 22 Dec 2020 01:48:17 +0100 Subject: [PATCH] src/here-pull-overlays: stylize; add header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maciej Barć --- src/here-pull-overlays | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/here-pull-overlays b/src/here-pull-overlays index 2dfea2c..b13300a 100755 --- a/src/here-pull-overlays +++ b/src/here-pull-overlays @@ -1,17 +1,21 @@ #!/usr/bin/env bash +# Original author: XGQT +# Licensed under the ISC License +# Copyright (c) 2020, src_prepare group + + set -o pipefail -trap 'exit 1' INT +trap 'exit 128' INT export PATH -emsg() -{ +emsg() { echo "$(tput bold)$(tput setaf 6)>>> $(tput setaf 4)$(date +%H:%M:%S)$(tput setaf 7) ${*} $(tput sgr0)" } -edie() -{ + +edie() { if [ -z "${1}" ] then emsg "$(tput setaf 1)Failed: last command" @@ -20,17 +24,16 @@ edie() fi exit 1 } -erun() -{ +erun() { emsg "Running: ${*}" "${@}" | busybox ts '>>> %H:%M:%S' || edie "${@}" } -einto() -{ + +einto() { pushd "${1}" >/dev/null || edie "Could not open ${1}" } -eback() -{ + +eback() { popd >/dev/null || edie }