我正在构建一个Ruby脚本来循环遍历多个目录,并bundle install在所有目录上运行git命令:
dirs = ['~/code1, ~/code2, ~/code3]
dirs.each do |dir|
Dir.chdir(dir) do
`git checkout develop`
`git pull`
`bundle install`
end
end
Run Code Online (Sandbox Code Playgroud)
当我这样做时,git在正确的目录中运行,但bundler在与脚本相同的目录中运行。
我尝试使用捆绑程序的--path选项,但是那也没有完成任务。
有任何想法吗?