Problem
not_if is confusing when cwd is specified with a directory that does not exist.
Minimal reproduce code
execute 'echo hello' do
cwd '/path/to/unknwon/dir'
not_if 'true'
end
$ itamae local test.rb --dry-run
INFO : Starting Itamae... (dry-run)
INFO : Recipe: /tmp/tmp.VzWjtHqt73/test.rb
INFO : execute[echo hello] executed will change from 'false' to 'true'
It should not be executed always because true command returns 0.
But cd /path/to/unknwon/dir returns non-zero value, so Itamae guesses it should be executed.
note
In this case, it will fail without --dry-run. Actually the directory will be create with another command.
How should it behave
I'm not sure.
I guess warning is a solution. Because I was confused by the behaviour, but I would not like to make it error. But I'm not sure what the error message, and the condition of the warning message.