mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
detect if command not available (usefull for windows users)
This commit is contained in:
parent
4bf9443b6f
commit
44a3fe8c35
1 changed files with 14 additions and 3 deletions
|
@ -29,12 +29,23 @@ module CapybaraWebkitBuilder
|
|||
end
|
||||
end
|
||||
|
||||
def sh(command)
|
||||
system(command)
|
||||
success = $?.exitstatus == 0
|
||||
if $?.exitstatus == 127
|
||||
puts "Command '#{command}' not available"
|
||||
elsif !success
|
||||
puts "Command '#{command}' failed"
|
||||
end
|
||||
success
|
||||
end
|
||||
|
||||
def makefile
|
||||
system("#{qmake_bin} -spec #{spec}")
|
||||
sh("#{qmake_bin} -spec #{spec}")
|
||||
end
|
||||
|
||||
def qmake
|
||||
system("#{make_bin} qmake")
|
||||
sh("#{make_bin} qmake")
|
||||
end
|
||||
|
||||
def path_to_binary
|
||||
|
@ -47,7 +58,7 @@ module CapybaraWebkitBuilder
|
|||
end
|
||||
|
||||
def build
|
||||
system(make_bin) or return false
|
||||
sh(make_bin) or return false
|
||||
|
||||
FileUtils.mkdir("bin") unless File.directory?("bin")
|
||||
FileUtils.cp(path_to_binary, "bin", :preserve => true)
|
||||
|
|
Loading…
Reference in a new issue