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..7fa9e08c6 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 + ['echo'] + end end end end diff --git a/lib/aruba/processes/spawn_process.rb b/lib/aruba/processes/spawn_process.rb index 4e4a48b2a..704f6fa8b 100644 --- a/lib/aruba/processes/spawn_process.rb +++ b/lib/aruba/processes/spawn_process.rb @@ -201,7 +201,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 @@ -259,6 +259,10 @@ def command_string # gather fully qualified path cmd = Aruba.platform.which(command, environment['PATH']) + if cmd.nil? and Aruba.platform.builtin_shell_commands.include?(command) + cmd = command + end + fail LaunchError, %(Command "#{command}" not found in PATH-variable "#{environment['PATH']}".) if cmd.nil? Aruba.platform.command_string.new(cmd)