bitfield/script

Conditinally execute statements.

HARDY8118 opened this issue · 4 comments

An if...fi block to execute statements conditionally can be added. For example:

script
    .If(script.File("key.txt")=="")
    .Then()
        .Echo(token)
        .WriteFile("key.txt")
    .Fi()

Please let me know if this can be useful.

Nice suggestion, @HARDY8118! We do have IfExists already—though it's in the opposite sense to what you want.

I can give a try implementing it

@bitfield What's the status of this? Is it still something we want to add to the package?

I haven't yet seen any evidence that the lack of this feature is a significant problem for a large group of users. I think until we have that, there are probably higher priority things to work on.