Comments (4)
I checked and gum log -l fatal hello
indeed returns an error status code. More precisely it returns 1. (See the image)
You should use &&
instead of ;
between your commands. The reason is that &&
ensures the second command only runs if the first command succeeds. This can help prevent potential issues if the first command fails for some reason.
from gum.
Hm, you're right. I'm still confused though since I use gum log -l fatal
in one of my scripts and it did exit the entire script before. Now it keeps executing (unless chained with &&
, like you said).
Wouldn't it make sense to exit
when encountering a fatal issue? As in:
if [[ -z $1 ]]; then gum log -l fatal "Not enough arguments"; fi
from gum.
I have tried to checkout the tags v0.13.0 and v0.12.0 and I can't reproduce the behaviour you're talking about. Can you please provide some more details like a version number and a reproducible example of the behaviour you think have changed.
Also you can stop the script by checking if the error code is 1.
from gum.
I am using version 0.14.1
. I remember before the 0.14.x
update, calling gum log -l fatal
would stop execution of following commands in a script. For example:
gum log -l fatal "Some error occurred"
echo hello
Here, the echo
command would not execute, since gum log -l fatal
would automatically exit the script, as it does in Go files (see here). This makes sense, considering we're dealing with a fatal error. Now, however, it does execute the following commands...
from gum.
Related Issues (20)
- `choose` crashes when in filter mode and you press `spacebar` twice HOT 1
- Gum choose "undefined: max" error HOT 6
- gum input header flags can output an incorrect render HOT 4
- `--cursor.foreground` not respected for `gum input` or `gum write`
- `choose` pagination has no indicators or prev/next since 0.14
- Helping hand HOT 2
- `gum input` mangling prompt (docs need updated) HOT 2
- gum confirm: Handling exit code 130 isn't working anymore HOT 3
- Shell gets stuck when `--placeholder` in `gum input` contains Japanese characters HOT 2
- Add preselected options when using filter command
- Ability to specify `huh` theme HOT 3
- Confirm does not allow to default to the negative action HOT 1
- Alternative for autocomplete in zsh HOT 1
- Filepicker fuzzy find
- A HOT 1
- problem running binary from tarball on osx sonoma HOT 2
- gum choose --selected=: cursor do not appear HOT 1
- gum spin messes the screen HOT 3
- 0.14: navigation by page via arrow keys no longer works HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gum.