You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been at this all day and I can't figure out what I'm doing wrong.
Here is the code:
## Get installation choicesdeclare -a OPTIONAL_APPS
declare -a APP_CATEGORIES
OPTIONAL_APPS=("Developer_Tools""DevOps_Tools""Artist_Tools")
APP_CATEGORIES=$(gum choose "${OPTIONAL_APPS[@]}" --no-limit --header "Select optional apps:")## test code for damn arrayforoptionin"${APP_CATEGORIES[@]}";doecho"option: $option"done
When I run this and choose a couple of things from the list, I expect the for loop to iterate through the choices and echo that "option ..." for each choice. However what I get instead is both choices as one string with a newline:
option: Developer_Tools
Artist_Tools
My lazyvim linter is also giving me some gripe about declaring APP_CATEGORIES as an array but using it as a string or something, which sounds about right.
I tried writing some test code and this works just fine:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been at this all day and I can't figure out what I'm doing wrong.
Here is the code:
When I run this and choose a couple of things from the list, I expect the for loop to iterate through the choices and echo that "option ..." for each choice. However what I get instead is both choices as one string with a newline:
My lazyvim linter is also giving me some gripe about declaring APP_CATEGORIES as an array but using it as a string or something, which sounds about right.
I tried writing some test code and this works just fine:
So what the heck am I doing wrong in the first example? This has been driving me nuts all day.
Beta Was this translation helpful? Give feedback.
All reactions