Contitional Scripting #10

Open jaysalw jaysalw opened this issue on 2026-03-05 · 2 comments
jaysalw jaysalw 2026-03-05 Author

Allow for the use of IF, ELSE, ELIF , and comparison operators:

==
!=
>
<
>=
<=

Using the following syntax:

IF condition == True {
     # Script goes here
} ELSE {
    # Script goes hers
} ELIF {
    # Script goes here
}

Variables:


Requesting Input:

IF INP IS SET TO BOOL THEN IT SHOULD SHOW A YES OR NO INPUT.

E.G.:

INP my_text = type, "my custom text here"
IF my_text == True { 
    #  SCRIPT HERE
}

would then display:

[INPUT] my custom text here | Y/N:

Where Y = True and N = False. With any Y/N "confirmer" it will always accept variations so lowercase, the word form (e..g "yes" "no") and will not be case sensitive.

Where type can be either STR, INT, FLOAT, LIST, DICT, etc

Usage of type casing such as int(x) or float(x), string(x).

FOR and WHILE loops, and MATCH functions (example below):

MATCH command {
    "install" {
        EXEC "pacman -S package"
    }
    "update" {
        EXEC "pacman -Syu"
    }
    DEFAULT {
        ECHO "Unknown command"
    }
}

File operations commands such as:

  • DELETE
  • FORCE
  • CLONE (for cloning another repo if needed for an install)
  • COPY
  • RENAME
  • ROLLBACK

The ROLLBACK tool will be used to undo a specific amount of previous actions. The old files WILL ALWAYS be saved in a ._backup folder with a list of commands run too. This expands upon the existing ROLLBACK feature ( fdf rollback ) which undoes an entire script.

jaysalw jaysalw 2026-03-05

Additionally, it needs to include a CONFIRM option which uses a temporary variable that gets reset after it has been used. For example:

IF CONFIRM {
   # Execute Script
}

When this is used it displays this question:

[ATTENTION] Would you like to continue? Y/N:

Options such as CONFIRM will be implemented, e.g.:

IF CONFIRM "THIS IS AN ACTION SUMMARY" {
    # Execute Script
}

Would thus show:

[ATTENTION] THIS IS AN ACTION SUMMARY | Would you like to continue? Y/N:

jaysalw jaysalw 2026-03-06

This has been implemented into v1.1_alpha (alpha will be released soon as pre-release).

I will do some more testing before closing this issue

Want to reply? View on GitHub