charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.83k stars 338 forks source link

using spin with cycles #336

Open fragolinux opened 1 year ago

fragolinux commented 1 year ago

hi, i've tihs code and i'd like to put it in some "spin" command, so the user knows something is going on in background... tried to put it in a function, same result, spin accepts only commands or scripts, not pieces of code or function, as it seems... hints? thanks

for profile in "${!profiles[@]}"; do
    PROFILE="$profile" ENABLED="${profiles[$profile]}" yq -i '.data.profiles.[env(PROFILE)].enabled |= env(ENABLED)' "$XDG_CONFIG_HOME/chezmoi/chezmoi.yaml"
done
piero-vic commented 3 days ago

This might work https://github.com/charmbracelet/gum/issues/419#issuecomment-2351679739