From 1c876c756cf80924003fd7791b2395aa9200000d Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Mon, 28 Nov 2016 13:53:51 +0100 Subject: [PATCH] Better error checking on install --- lib/os.lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/os.lib.sh b/lib/os.lib.sh index 4e8b8ad..7457ce2 100644 --- a/lib/os.lib.sh +++ b/lib/os.lib.sh @@ -110,19 +110,19 @@ zaf_is_root(){ # $2 - directory zaf_install(){ zaf_dbg "Install file $1 to $INSTALL_PREFIX/$2/$(basename $1)" - $ZAF_DO cp "$1" "$INSTALL_PREFIX/$2/$(basename $1)" + $ZAF_DO cp "$1" "$INSTALL_PREFIX/$2/$(basename $1)" || zaf_err "Cannot create file $INSTALL_PREFIX/$2/$(basename $1)!" } # $1 - src file # $2 - directory zaf_install_bin(){ zaf_dbg "Install binary $1 to $INSTALL_PREFIX/$2/$(basename $1)" - $ZAF_DO cp "$1" "$INSTALL_PREFIX/$2/$(basename $1)" + $ZAF_DO cp "$1" "$INSTALL_PREFIX/$2/$(basename $1)" || zaf_err "Cannot create binary $INSTALL_PREFIX/$2/$(basename $1)!" $ZAF_DO chmod +x "$INSTALL_PREFIX/$2/$(basename $1)" } # $1 - directory zaf_install_dir(){ zaf_dbg "Install directory $1 to $INSTALL_PREFIX/$1" - $ZAF_DO mkdir -p "$INSTALL_PREFIX/$1" + $ZAF_DO mkdir -p "$INSTALL_PREFIX/$1" || zaf_err "Cannot create directory $INSTALL_PREFIX/$1!" } # $1 - file zaf_touch(){