charmbracelet / gum

A tool for glamorous shell scripts 🎀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gum spin only accepts a hard-coded command

Tazi0 opened this issue · comments

commented

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.