diff --git a/lib/mina/commands.rb b/lib/mina/commands.rb index 3356cb92..0777dfea 100644 --- a/lib/mina/commands.rb +++ b/lib/mina/commands.rb @@ -30,6 +30,10 @@ def delete(stage) queue.delete(stage) || [] end + def empty(stage = :default) + queue[stage] = [] + end + def process(path = nil) if path queue[stage].unshift(%{echo "$ cd #{path}"}) if fetch(:verbose) diff --git a/tasks/mina/default.rb b/tasks/mina/default.rb index c4f8cf90..f44129a7 100644 --- a/tasks/mina/default.rb +++ b/tasks/mina/default.rb @@ -17,7 +17,11 @@ task :run_commands do if commands.run_default? + # all this so remote_environent is inserted in before all other commands + old_commands = commands.queue[:default] + commands.empty invoke :remote_environment + commands.queue[:default] += old_commands commands.run(:remote) end end