/ bin / sh:-c:第1行:语法错误:bash中的文件意外结束

时间:2019-08-27 19:30:06

标签: bash shell makefile scripting

我在Makefile中有以下代码:

PROJECT=accounts/$(LZ)
VALUES=${PROJECT}/values/$(VALUES_FOLDER)
HELM=helm 
VALUES_ARGUMENT=''

lint:
if [ -z "${VALUES}" ]; then \
    for file in ${VALUES}/*; do \
        VALUES_ARGUMENT+=" $(basename "$file")"; \
    done \
    ${HELM} lint ${PROJECT} -f ${PROJECT}/values/${VALUES_ARGUMENT} ; \
else \
    echo "No Value Files Exist for ${LZ}" ; \
fi

我使用make lint LZ=contentmgmt VALUES_FOLDER=prod-vir在终端中运行此命令,但始终失败:

    kaulk$ make lint LZ=contentmgmt VALUES_FOLDER=prod-vir
if [ -z "accounts/contentmgmt/values/prod-vir" ]; then \
        for file in accounts/contentmgmt/values/prod-vir/*; do \
            VALUES_ARGUMENT+=" "; \
        done \
        helm  lint accounts/contentmgmt -f accounts/contentmgmt/values/'' ; \
    else \
        echo "No Value Files Exist for accounts/contentmgmt" ; \
    fi
/bin/sh: -c: line 0: syntax error near unexpected token `helm'
/bin/sh: -c: line 0: `if [ -z "accounts/contentmgmt/values/prod-vir" ]; then    for file in accounts/contentmgmt/values/prod-vir/*; do      VALUES_ARGUMENT+=" "; done  helm  lint accounts/contentmgmt -f accounts/contentmgmt/values/'' ; else    echo "No Value Files Exist for accounts/contentmgmt" ; fi'
make: *** [lint] Error 2

我正在关闭for块,如果要关闭,则无法确定问题到底在哪里?

0 个答案:

没有答案