charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

Gum spin only accepts a hard-coded command #564

Closed Tazi0 closed 5 months ago

Tazi0 commented 5 months ago

Is your feature request related to a problem? Please describe. I have created a function which passes a command which the gum spin needs to execute:

repo_update() {
....
}

spin() {
  local TITLE="${*: -1}"
  local COMMANDO="${*:1:$(($#-1))}"
  gum spin "$COMMANDO" --spinner="dot" --title="$TITLE"
}

Usage:

spin repo_update "Updating repo"

But this only gives me an error, it does not execute it

Describe the solution you'd like that the gum spin command runs as expected and accepts strings which it runs.