Giter Site home page Giter Site logo

Comments (4)

MikaelFangel avatar MikaelFangel commented on September 10, 2024

I checked and gum log -l fatal hello indeed returns an error status code. More precisely it returns 1. (See the image)

Screenshot 2024-05-13 at 13 46 07

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.

alexschcom avatar alexschcom commented on September 10, 2024

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.

MikaelFangel avatar MikaelFangel commented on September 10, 2024

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.

alexschcom avatar alexschcom commented on September 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.