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

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

Merged

Conversation

Ph0enixKM
Copy link
Member

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 Ph0enixKM linked an issue Jun 5, 2024 that may be closed by this pull request
@Ph0enixKM Ph0enixKM self-assigned this Jun 5, 2024
@Ph0enixKM Ph0enixKM marked this pull request as ready for review June 5, 2024 15:15
@Ph0enixKM Ph0enixKM changed the title feat: repurpose args inside of main to work as an array The main block should accept args array as an argument Jun 5, 2024
@Ph0enixKM
Copy link
Member Author

Disclaimer: The installer script has to be probably rewritten now

@Ph0enixKM
Copy link
Member Author

Ph0enixKM commented Jun 5, 2024

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

Copy link
Contributor

@arapower arapower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@b1ek b1ek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Ph0enixKM Ph0enixKM merged commit 8d2a4d9 into master Jun 6, 2024
1 check passed
@Ph0enixKM Ph0enixKM deleted the 153--the-main-block-should-accept-args-array-as-an-argument branch June 6, 2024 07:45
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

Successfully merging this pull request may close these issues.

🐞 The main block should accept args array as an argument
3 participants