mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.35k stars 490 forks source link

Issue when change the directory before git:clone #477

Closed sobrinho closed 7 years ago

sobrinho commented 7 years ago

Hi! Here mina tries to clone the branch to the current directory but if we do something like this:

task :something do
  in_path(fetch(:some_path)) do
    command 'touch something'
  end
end

task :deploy do
  deploy do
    invoke :something
    invoke :'git:clone'
  end
end

I'm not sure if the issue is on in_path which do not restores the previous path or with git:clone which tries to use . instead of the fullpath.

Which one should be fixed?

I believe that the best choice would be in_path restores the previous path after the block is invoked.

sobrinho commented 7 years ago

In both cases, I can provide a pull request.