Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mina doesnt report elapsed time after a run (Windows) #381

Closed
dynasource opened this issue Apr 22, 2016 · 2 comments
Closed

Mina doesnt report elapsed time after a run (Windows) #381

dynasource opened this issue Apr 22, 2016 · 2 comments

Comments

@dynasource
Copy link

Investigation shows that running the command 'exec' (see http://rubyquicktips.com/post/5862861056/execute-shell-commands) quits the application and therefore report_time isnt finishing its report.

A solution is the following:

    module SshHelpers
        module Ssh  
            def invoke(script, this)
                # Ruby 1.8.7 doesn't let you have empty symbols
                term_mode = :"#{this.settings.term_mode}" if this.settings.term_mode
                code = "#{this.ssh_command} -- #{script}"

                # Certain environments can't do :pretty mode.
                term_mode = :exec  if term_mode == :pretty && !pretty_supported?
                is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) 
                case term_mode
                when :pretty
                  this.pretty_system(code)
                when :exec && !is_windows
                  exec code
                else
                  system code
                  $?.to_i
                end
              end   
            end
        end
    end
@dynasource
Copy link
Author

same applies for module LocalHelpers

@d4be4st
Copy link
Member

d4be4st commented Jul 30, 2016

Exec is working as intented. It does what you said it does and as such wont report time as time is outputed after all tasks are finished.

This has nothing to do with windows, and what you suggested would break some tasks that depend on this feature, example is: ssh

@d4be4st d4be4st closed this as completed Jul 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants