ios - iOS 应用程序的 xcode 中的 Uncrustify 错误

标签 ios iphone xcode5 code-formatting uncrustify

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

最佳答案

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

enter image description here

(截取自 here )。

关于ios - iOS 应用程序的 xcode 中的 Uncrustify 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20968158/

相关文章:

ios - 在 Storyboard 中直接向 UITextView 添加属性文本

objective-c - Xcode 5——测试目标没有完成

javascript - Extractzipfile 插件有错误 : plugin not found in ios

iphone - Xcode中如何编译第三方c库?

iphone - 苹果命令行工具 : Force Universal Binary with a Single Arch?

xcode - 我如何让 Xcode 和 Git 相信我的 Assets 目录已经更新?

ios - 仅在异步函数执行完毕后运行代码

ios - CGContextStrokePath 颜色

ios - iPhone x 上的 Y 位置关闭

ios - 如何在 iOS 中为模拟器和设备 (IPA) 构建框架