Hi All,
I have below code. even though my service name does not exist, it still skipping the execute command.
execute ‘test’ do
command "echo hi"
not_if { ‘sc query “asdfiusadf”’ }
end
Hi All,
I have below code. even though my service name does not exist, it still skipping the execute command.
execute ‘test’ do
command "echo hi"
not_if { ‘sc query “asdfiusadf”’ }
end
This is because the guard format is incorrect:
# if a string is passed, then it's just a shell command
not_if "sc query 'asdfiusadf'"
# if a Ruby block is passed, it must eval truthy
not_if { true }
Details are here
Thanks @cheeseplus