Merge "Check whether the source file exists before configuring the dashboard"

This commit is contained in:
Zuul 2018-01-20 14:08:27 +00:00 committed by Gerrit Code Review
commit 9ce572a3a8
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ function config_dashboard {
ENABLE=$1
SRC=$2
DEST=$3
if [[ "${ENABLE}" == "yes" ]] && [[ ! -f "${DEST}" ]]; then
if [[ ! -f ${SRC} ]]; then
echo "WARNING: ${SRC} is required"
elif [[ "${ENABLE}" == "yes" ]] && [[ ! -f "${DEST}" ]]; then
cp -a "${SRC}" "${DEST}"
FORCE_GENERATE="yes"
elif [[ "${ENABLE}" != "yes" ]] && [[ -f "${DEST}" ]]; then