Problem (bug?) with sh() inside if()

Hi. I was testing sh() to run shell commands, and I found what I think is a bug.

In KWGT, just place a Text with this formula (based on the if() function example):

$if(df(f)>5, sh("echo 'Weekend: "+df(h:mm:ss)+"'>>'/sdcard/myfile.txt'"), "Workday :(")$

And you'll see that the sh() function is executed even when the condition is not met.
I get a /sdcard/myfile.txt with several "Weekend" + time at least each time the widget is displayed or when the phone display is on.

Thank you.

This is not a bug this is how the function parser is made, the arguments will be parsed before evaluating the if cause, this will be execute anyway, unfortunately there is no way to do event based things in Kustom yet.