165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
# File 'lib/train/extras/command_wrapper.rb', line 165
def self.load(transport, options)
if transport.platform.unix?
return nil unless LinuxCommand.active?(options)
res = LinuxCommand.new(transport, options)
verification_res = res.verify
if verification_res
msg, reason = verification_res
raise Train::UserError.new("Sudo failed: #{msg}", reason)
end
res
elsif transport.platform.windows?
res = WindowsCommand.new(transport, options)
res
end
end
|