在CocoaPods post_install步骤中运行bash命令

Jaw*_*wap 16 objective-c cocoapods

git submodule init在完成安装pod之后,我想让CocoaPods 在项目根目录中运行.有一个post_install挂钩,但我发现很少有关于如何使用它的信息.它可以用来运行任意bash命令吗?

Jaw*_*wap 32

嗯,这比预期的要容易......

post_install do |installer|
  system("git submodule init")
end
Run Code Online (Sandbox Code Playgroud)