0

我已经通过 brew 安装了 uncrustify(根据 git 指令),并且我已经将运行脚本构建阶段添加到 xcode 并尝试构建一个 ios 项目,但是构建失败并出现以下错误:

**/bin/sh: /Users/test/Library/Developer/Xcode/DerivedData/testProj- amlbymrfycxuzmemclwtovltjxzl/Build/Intermediates/testProj.build/Debug-iphoneos/testProj.build/Script-AC898878187BE0A00056CAB1.sh: sh: bad interpreter: No such file or directory**

如何解决此错误?任何帮助,将不胜感激。提前致谢。

我的 sh 脚本:

if [ -n "$1" ]
    then

    # recover directory to format :
    pathToSourcesDirectory=`echo $(pwd)/$1`

    # go to current folder :
    scriptDirectory=$(dirname $0)
    cd $scriptDirectory

    # find sources files to format :
    echo ""
    echo "==> Getting files to format in directory " + $pathToSourcesDirectory
    mkdir -p temp
    find $pathToSourcesDirectory -name "*.[mh]" > temp/sources_to_uncrustify.txt

    # format files :
    echo ""
    echo "==> Format files" 
    /usr/local/bin/uncrustify -F temp/sources_to_uncrustify.txt -c "../uncrustify_objective_c.cfg" --no-backup 

    # remove temp files : 
    rm -rf temp/

else 
    echo "Error : You must specify a source folder as first parameter"  

fi
4

1 回答 1

1

看起来您没有在 Xcode Run Script配置中设置Shell/bin/sh

在此处输入图像描述

(从这里截取的屏幕截图)。

于 2014-01-07T09:46:36.060 回答