diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb index 6ce3dc9e1..6cb591c1f 100644 --- a/lib/aruba/platforms/unix_platform.rb +++ b/lib/aruba/platforms/unix_platform.rb @@ -236,6 +236,10 @@ def simple_table(hash, opts = {}) def which(program, path = ENV['PATH']) UnixWhich.new.call(program, path) end + + def builtin_shell_commands + [] + end end end end diff --git a/lib/aruba/platforms/windows_platform.rb b/lib/aruba/platforms/windows_platform.rb index f40fbd3af..268154551 100644 --- a/lib/aruba/platforms/windows_platform.rb +++ b/lib/aruba/platforms/windows_platform.rb @@ -37,6 +37,10 @@ def environment_variables def which(program, path = ENV['PATH']) WindowsWhich.new.call(program, path) end + + def builtin_shell_commands + ['cd', 'dir', 'echo', 'exit', 'set', 'type'] + end end end end diff --git a/lib/aruba/processes/spawn_process.rb b/lib/aruba/processes/spawn_process.rb index f85e6f420..1ff04dc89 100644 --- a/lib/aruba/processes/spawn_process.rb +++ b/lib/aruba/processes/spawn_process.rb @@ -206,7 +206,7 @@ def terminate end @exit_status = @process.exit_code - + @stdout_cache = read_temporary_output_file @stdout_file @stderr_cache = read_temporary_output_file @stderr_file @@ -262,12 +262,11 @@ def interactive? def command_string fail LaunchError, %(Command "#{command}" not found in PATH-variable "#{environment['PATH']}".) if command_path.nil? - Aruba.platform.command_string.new(command_path, *arguments) end def command_path - @command_path ||= Aruba.platform.which(command, environment['PATH']) + @command_path ||= (Aruba.platform.builtin_shell_commands.include?(command) ? command : Aruba.platform.which(command, environment['PATH'])) end def wait_for_io(time_to_wait)