为什么 git 预接收挂钩未检测到 puppet-lint?

Why is the git pre-receive hook not detecting puppet-lint?

我正在使用 drwahl/puppet-git-hooks

我在我的本地计算机上安装了 puppet-lint,但是当我执行 git push origin puppet_hook 时,我得到以下输出:

Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 345 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Checking puppet manifest syntax for manifests/init.pp...
remote: Error: Could not parse for environment production: Syntax error at '}' at manifests/init.pp:3
remote: Error: puppet syntax error in manifests/init.pp (see above)
remote: Error: 1 syntax error(s) found in puppet manifests. Commit will be aborted.
remote: puppet-lint not installed. Skipping puppet-lint tests...
remote: Error: 1 subhooks failed. Declining push.
remote: Hook /var/tmp/hooks/pre-receive.puppet failed with error code 1

如您所见:

remote: puppet-lint not installed. Skipping puppet-lint tests...

当我追踪到预接收脚本(上面提供的)时,我发现了以下检查:

 #puppet manifest styleguide compliance
        if [ "$CHECK_PUPPET_LINT" != "disabled" ] ; then
            if type puppet-lint >/dev/null 2>&1; then
                if [ $(echo $changedfile | grep -q '\.*.pp$' ; echo $?) -eq 0 ]; then
                    ${subhook_root}/puppet_lint_checks.sh $CHECK_PUPPET_LINT $tmpmodule "${tmptree}/"
                    RC=$?
                    if [ "$RC" -ne 0 ]; then
                        failures=`expr $failures + 1`
                    fi
                fi
            else
                echo "puppet-lint not installed. Skipping puppet-lint tests..."
            fi
        fi

它似乎在以下位置失败:

if type puppet-lint >/dev/null 2>&1; then

当我在本地运行上述命令时,它是成功的。

为什么不通过预接收脚本检测 puppet-lint

检查您要访问的服务器。您是 运行 的用户可能没有设置别名,或者路径中有 puppet-lint