From 29e78ce3e8aa19fed02fc8a68c137813145daf27 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Jan 14 2020 13:03:31 +0000 Subject: add error messages into copy function --- diff --git a/env-builder-data/build/script/common/helpers.sh b/env-builder-data/build/script/common/helpers.sh index 2665a20..fb55d6a 100644 --- a/env-builder-data/build/script/common/helpers.sh +++ b/env-builder-data/build/script/common/helpers.sh @@ -63,14 +63,17 @@ copy() { fi if [ "$(ls -A $1)" ]; then if ! cp --remove-destination -rlP $SRC/* "$DEST/"; then + echo "Error while copying directory [$SRC] -> [$DEST]" return 1 fi fi elif [ -f "$SRC" ]; then if ! (mkdir -p `dirname $DEST` && cp --remove-destination -l "$SRC" "$DEST"); then + echo "Error while copying file [$SRC] -> [$DEST]" return 1 fi else + echo "Error while copying [$SRC] -> [$DEST/]: source does not exists" return 1 fi }