【问题标题】:error with Uncrustify in xcode for an ios appios应用程序的xcode中的Uncrustify错误
【发布时间】:2014-01-07 09:35:21
【问题描述】:

我已经通过 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

【问题讨论】:

    标签: ios iphone xcode5 code-formatting uncrustify


    【解决方案1】:

    您似乎没有在 Xcode Run Script 配置中将 Shell 设置为 /bin/sh

    (截图取自here)。

    【讨论】:

    • 在配置中我已经添加了像这样的文件路径 sh CodeFormatter/scripts/formatOpenedSources.sh 我已经将 CodeFormatter/scripts/formatOpenedSources.sh 文件添加到项目中
    • @RaviKiran 将 sh 更改为 /bin/sh
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-04
    • 1970-01-01
    相关资源
    最近更新 更多