Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditinally execute statements. #195

Open
HARDY8118 opened this issue Dec 2, 2023 · 2 comments
Open

Conditinally execute statements. #195

HARDY8118 opened this issue Dec 2, 2023 · 2 comments

Comments

@HARDY8118
Copy link

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.

@bitfield
Copy link
Owner

bitfield commented Dec 3, 2023

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

@HARDY8118
Copy link
Author

I can give a try implementing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants