Commit graph

13 commits

Author SHA1 Message Date
Jelle Besseling f4d198396f
feat(spin): Add support for --show-error for the spinner. (rebase #440) (#518)
* feat(spin): Add support for `--show-error` for the spinner.

This makes it so that if the `--show-error` flag is provided then the
full output of the command will be printed if the command fails. This
kind of works in conjuncture with `--show-output` in that if the command
succeeds only STDOUT is pushed. If the command fails both `STDOUT` and
`STDERR` are pushed.

This builds off of https://github.com/charmbracelet/gum/pull/371

Resolves #55

* chore: Fix formatting

---------

Co-authored-by: Elliot Courant <me@elliotcourant.dev>
2024-03-28 13:11:07 -04:00
Dieter Eickstaedt f8caeef195
feat: Timeout for Spin Command (#385)
* feat: Timeout for Spin Command

* fix: spin timeout

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-06-30 09:17:09 -04:00
Rose Thatcher f048bd8d87
feat(Spin): Option to show live output (#303)
* Added live output buffer and option flag

* Update Spin on README.md

* Returned output formatting to previous version.

* Separated the showOutput and liveOutput flags.
Both flags can now be used at once.

* Removed liveOutout flag
showOutput flag is now realtime

* (spin) Consolodated stderr and stdout

* (spin) Consolodated stdout and stderr

* (spin) If being piped, writes to stdout

* Added error check and did some housekeeping

* No longer outputs to tea.View if piped

* Cleaned up the combining of stderr and stdout

* Fixed spinner alignment.  Updated Readme
2023-06-27 10:31:54 -04:00
Greg Kroah-Hartman 6677920319 feat: add alignment for spinner title
Sometimes it is nice to spin to the right side of the title, not the
left, so add a --align option to pick the left or right side.  The
default remains "left".

New option is:
	--align="left|right"
and the environment variable GUM_SPIN_ALIGN can also be used.
2022-10-02 14:42:19 -04:00
Maas Lalani 1479184f3f fix: satisfy all linters 2022-08-05 02:33:40 -04:00
Maas Lalani 46ce0e4761 feat: allow configuration via environment variables 2022-08-04 11:22:42 -04:00
Maas Lalani bba0f3b1e0
refactor: remove unneeded set:"name=" 2022-08-03 12:28:02 -04:00
Maas Lalani 61a9219d0a feat(spin): --show-output and exit code should match command's 2022-07-30 18:04:26 -04:00
Christian Muehlhaeuser 66993d8ef1
Add soft & hard linter configs & workflows (#44)
* chore: add linter configs & workflows

* fix: ignore certain linter warnings

* fix: mark errors as intentionally ignored

* fix: avoid unnecessary conversion

* fix: handle template/renderer errors

* fix: mark intentionally unused code
2022-07-30 12:32:59 -04:00
Maas Lalani 4f1d174175
feat: add -s short flag for spinner 2022-07-20 13:26:44 -04:00
Maas Lalani 02e925ea57
refactor: use embedded style struct for all lipgloss styling
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
2022-07-12 16:08:33 -04:00
Maas Lalani fa4f09a413
feat: Default accent color is 212 (Bubble Gum Pink) 2022-07-07 17:46:22 -04:00
Maas Lalani 454040cf4d
feat: Add gum spin command
Spin provides a shell script interface for the spinner bubble. It is
useful for displaying that some task is running in the background while
consuming it's output so that it is not shown to the user.

For example, let's do a long running task:
```
sleep 5
```

We can simply prepend a spinner to this task to show it to the user,
while performing the task / command in the background.

```
gum spin -t "Taking a nap..." -- sleep 5
```

The spinner will automatically exit when the task is complete.
2022-07-07 13:29:10 -04:00