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

fix(aws): Fix select-aws-profile script functionality and style #946

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

reinno
Copy link
Contributor

@reinno reinno commented Sep 10, 2024

What

  • Rename main function to 'main' and add --env flag for environment modification
  • Fix region handling to properly check for null values

Why

The aws/select-aws-profile script syntax is outdated

➜ nu
Error: nu::parser::named_as_module

  × Can't export command named same as the module.
    ╭─[~/.config/nushell/nu_scripts/modules/aws/select-aws-profile.nu:12:12]
 11 │ #     select-aws-profile
 12 │ export def select-aws-profile [] {
    ·            ─────────┬────────
    ·                     ╰── can't export from module select-aws-profile
 13 │     hide AWS_REGION;
    ╰────
  help: Module select-aws-profile can't export command named the same as the module. Either change the module name, or export `main` command.

- Rename main function to 'main' and add --env flag for environment modification
- Improve profile selection logic using reduce and string interpolation
- Fix region handling to properly check for null values
@fdncred fdncred merged commit fb8901e into nushell:main Sep 11, 2024
1 check passed
@fdncred
Copy link
Collaborator

fdncred commented Sep 11, 2024

Thanks

@reinno reinno deleted the fix/select-aws-profile branch September 11, 2024 11:21
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.

2 participants