Ph0enixKM / Amber

💎 Amber the programming language compiled to bash
https://amber-lang.com
GNU General Public License v3.0
3.53k stars 70 forks source link

The main block should accept args array as an argument #154

Closed Ph0enixKM closed 3 weeks ago

Ph0enixKM commented 3 weeks ago

Now instead of getting args this way where each arg is of type Text

main (arg1, arg2, arg3) {

}

We can get them this way where the args variable is of type [Text]

main (args) {

}
Ph0enixKM commented 3 weeks ago

Disclaimer: The installer script has to be probably rewritten now

Ph0enixKM commented 3 weeks ago

Oh never mind. It seems that it very well compiles. Perhaps due to the reason that we already use this variable as an array and it just seems to work:

main(args) {
    let os = get_os()
    let arch = get_arch()

    let user_only_install = includes(args, "--user")
    // ...

The same thing for uninstaller script