Closed mbigras closed 7 years ago
The fix was to add parenthesis when calling sh
still not sure why. I also updated the wiki
require 'methadone'
include Methadone::CLILogging
include Methadone::SH
include Methadone::Main
main do
puts "Hello world!"
if sh("touch foo") == 0
puts "touch successful"
# do other things
else
puts "Something, went wrong: #{$!}"
end
end
go!
I created a small example using Methadone's
sh
method following the example on the wiki. The repo at mbigras/sh-weirdness.It seems like check
if sh "touch foo" == 0
doesn't work.I get the following error message
no implicit conversion of false into String
If I assign it's value to variable then everything works as expected, as shown below:
t;dr:
the diff looks like:
long version:
Before putting sh above if
following example on: https://github.com/davetron5000/methadone/wiki/Tutorial_LoggingAndDebugging
app.rb:
result:
error msg:
no implicit conversion of false into String
After putting sh above if
app.rb:
result:
no error.