Giter Club home page Giter Club logo

Comments (12)

ppsx avatar ppsx commented on May 15, 2024 2

Nonono :)
Thanks for creating it!

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

👍 We will try to fix this.

As a workaround you can make a script file and run that with gum spin ./file.sh

from gum.

muesli avatar muesli commented on May 15, 2024

Try and set the environment variable before gum, which should pass the entire environment on to the sub-command:

VARIABLE="foobar" gum spin command

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Also if you want to use the output of the command to the variable use --show-output and assign that.

VARIABLE=$(gum spin --show-output ....)

from gum.

ppsx avatar ppsx commented on May 15, 2024

Hi. Thanks for super-quick response.
It's rather a bit different scenario:
gum spin --title="Getting possible options..." LIST_OF_POSSIBLE_VALUES=$(aws s3 ls ...)
But the idea with external script is quite useful. Thanks for that :)

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

This should work:

LIST_OF_POSSIBLE_VALUES=$(gum spin --show-output --title="Getting possible options..." aws s3 ls ...)

from gum.

ppsx avatar ppsx commented on May 15, 2024

This should work:

LIST_OF_POSSIBLE_VALUES=$(gum spin --show-output --title="Getting possible options..." aws s3 ls ...)

It's not, sorry :) Tried that before and tried that again.

from gum.

ppsx avatar ppsx commented on May 15, 2024

Ah, one more thing... What if the inner command output has to be processed with grep/sed/whatever?
I think the external script is the right way as otherwise the solution is too complicated (and actually not really required as the quite straightforward workaround is present).

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Can you try that again with the latest code, I pushed a fix that should make it work now:
#95

If it doesn't please reopen the issue

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Ah, one more thing... What if the inner command output has to be processed with grep/sed/whatever? I think the external script is the right way as otherwise the solution is too complicated (and actually not really required as the quite straightforward workaround is present).

You can write to a file instead of a variable to allow more global state sharing.

aws s3 ls > possible_options.txt

from gum.

ppsx avatar ppsx commented on May 15, 2024

I've build gum from current sources. You're ritght, it's displaying spinner and gets data in the background. Cool :)
You're awsome, thanks!

from gum.

maaslalani avatar maaslalani commented on May 15, 2024

Thank you for using Gum! @ppsx

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.