mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-08-17 09:20:28 +03:00
Updated select-aws-profile script to work with nushell version >= 0.94.2
Signed-off-by: necromeo <andrescheel@protonmail.com>
This commit is contained in:
parent
398cc82308
commit
c497d09293
@ -9,16 +9,13 @@
|
||||
#
|
||||
# Usage
|
||||
# select-aws-profile
|
||||
export def select-aws-profile [] {
|
||||
export def --env main [] {
|
||||
hide AWS_REGION;
|
||||
|
||||
(do {
|
||||
let creds = (open ($env.HOME + "/.aws/credentials") | from toml)
|
||||
let selectedProfile = (for it in ($creds | transpose name creds) {
|
||||
echo $it.name
|
||||
})
|
||||
|
||||
selectedProfile = selectedProfile | str join "\n" | fzf | str trim
|
||||
let profiles = $creds | transpose name creds | each {|x| printf $x.name }
|
||||
let selectedProfile = $profiles | str join "\n" | fzf | str trim
|
||||
|
||||
if $selectedProfile != "" {
|
||||
let out = {
|
||||
@ -42,4 +39,4 @@ export def select-aws-profile [] {
|
||||
AWS_SECRET_ACCESS_KEY: $env.AWS_SECRET_ACCESS_KEY,
|
||||
AWS_REGION: $env.AWS_REGION
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user