Cocoapod install以前和以后如何hook作一些其余操做

合伙呀官方网站iOS系列经验教程shell

在pod install 以前能够作一些其余处理的时候在pre_install里写脚本便可
pre_install do |installer|
    puts "pre install hook"
    Pod::UI.puts "pre install hook puts UI"
end

在pod install 以后能够作一些其余处理的时候在post_install里写脚本便可
post_install do |installer|
  puts "post install hook"
  exec 'pwd'
end

这俩hook方法还能够作一些其余语言脚本的执行,好比执行shell脚本,使用exec 后面跟上具体命令便可
sh命令文件是同样的
相关文章
相关标签/搜索