From cc4c99b96d78f3c3c089d7eab914ed0fec66e216 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Wed, 2 Aug 2023 16:47:47 +0300 Subject: [PATCH] Error if board prefix or suffix was not set https://github.com/andreika-git/hellen-one/issues/318 --- bin/step2_copy_with_docker.sh | 11 +++++++++++ bin/step3_create_board_with_docker.sh | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/bin/step2_copy_with_docker.sh b/bin/step2_copy_with_docker.sh index 3bf3d06..2bbdd14 100644 --- a/bin/step2_copy_with_docker.sh +++ b/bin/step2_copy_with_docker.sh @@ -16,6 +16,17 @@ fi # '/${PWD##*/}' is doing the $pwd basename thing again source revision.txt + +if [ -z "${BOARD_PREFIX}" ]; then + echo "Error! BOARD_PREFIX is not set!" + exit 1 +fi + +if [ -z "${BOARD_SUFFIX}" ]; then + echo "Error! BOARD_SUFFIX is not set!" + exit 2 +fi + echo "BOARD_REVISION=[${BOARD_REVISION}]" docker run --rm -t --user $(id -u):$(id -g) --entrypoint python3 -v "$(pwd)":/${PWD##*/} hellen-one ./bin/copy_from_Kicad.py "frames:${BOARD_PREFIX}" "/${PWD##*/}" "../../gerber" "${BOARD_SUFFIX}" "${BOARD_REVISION}" diff --git a/bin/step3_create_board_with_docker.sh b/bin/step3_create_board_with_docker.sh index 304344e..0486850 100644 --- a/bin/step3_create_board_with_docker.sh +++ b/bin/step3_create_board_with_docker.sh @@ -8,6 +8,17 @@ fi # See step2_copy_with_docker.sh for explanation of the following command source revision.txt + +if [ -z "${BOARD_PREFIX}" ]; then + echo "Error! BOARD_PREFIX is not set!" + exit 1 +fi + +if [ -z "${BOARD_SUFFIX}" ]; then + echo "Error! BOARD_SUFFIX is not set!" + exit 2 +fi + echo "BOARD_REVISION=[${BOARD_REVISION}]" docker run --rm -t --user $(id -u):$(id -g) --entrypoint bash -v "$(pwd)":/${PWD##*/} hellen-one ./bin/create_board_with_prefix.sh "${BOARD_PREFIX}" "/${PWD##*/}" "${BOARD_SUFFIX}" "${BOARD_REVISION}" "bom_replace_${BOARD_PREFIX}${BOARD_SUFFIX}-${BOARD_REVISION}.csv " "${BOARD_PCB_OFFSET}"