Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable Configuration #574

Open
charlespierce opened this issue Oct 17, 2019 · 8 comments
Open

Portable Configuration #574

charlespierce opened this issue Oct 17, 2019 · 8 comments

Comments

@charlespierce
Copy link
Contributor

Suggested in #569: A way to export / import your volta configuration (default versions, installed packages + versions, hooks, etc.) so that they can be easily moved between machines and bootstrapped. See, e.g. brew bundle

@collegeimprovements
Copy link

Thanks for creating separate issue :)
For now, I'm trying to get the output of volta list --format=plain command to some text file.
Somehow volta list --format=plain > volta_list.txt is not working.

Probably a stupid bash/sh/zsh question - but how can we store output of volta list --format=plain in some file 🙈

@charlespierce
Copy link
Contributor Author

Hi @collegeimprovements, you found another bug! It looks like volta list is currently writing its output using our logging interface, instead of directly to the terminal. So that means it’s writing to stderr instead of stroud.

We’ll get that updated, but in the interim you should be able to do:

$ volta list --format plain 2> volta_list.txt

To write the output to a file.

@charlespierce
Copy link
Contributor Author

Opened #581 To fix the stderr -> stdout issue.

@collegeimprovements
Copy link

Oh! Thanks a lot @charlespierce .
I tried volta list --format plain 2> volta_list.txt but it's also not working for me due to some reason.

λ › volta list --format plain 2> volta_list.txt                                                                         ~/Desktop
runtime [email protected] (default)
package-manager [email protected] (default)
package [email protected] / ask / [email protected] npm@built-in (default)
package [email protected] / cypress / [email protected] npm@built-in (default)
package [email protected] / fkill / [email protected] npm@built-in (default)
package [email protected] / fx / [email protected] npm@built-in (default)
package [email protected] / gtop / [email protected] npm@built-in (default)
package [email protected] / iponmap / [email protected] npm@built-in (default)
package [email protected] / pageres / [email protected] npm@built-in (default)
package [email protected] / parcel / [email protected] npm@built-in (default)
package [email protected] / tsserver, tsc / [email protected] npm@built-in (default)
λ › cat volta_list.txt                                                                                                  ~/Desktop
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: volta_list.txt   <EMPTY>
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
λ ›                                                                                                                     ~/Desktop

@charlespierce
Copy link
Contributor Author

Hi @collegeimprovements, I just traced this down and the issue wasn't actually about stderr vs stdout, it was related to our detection of the default log level. We'll have a release today (0.6.5), which will include the fix from #581, at which point it will work with volta list --format plain > volta_list.txt

In the interim, it should work if you do:

$ VOLTA_LOGLEVEL=info volta list --format plain > volta_list.txt

@collegeimprovements
Copy link

collegeimprovements commented Nov 21, 2019

Update: volta list --format plain > volta_list.txt works now.

I created a file generate_volta_list.sh with following command:

volta list --format plain > volta_list.txt

and it gives the following error:

create_or_update_volta_list.sh: line 1: volta: command not found

Am I missing setting PATHs properly ? This is not causing any problem. I'm just curious.

Edit: This works now. Thanks a lot @charlespierce. For now I rely on good old zsh-tricks :)

@charlespierce
Copy link
Contributor Author

Excellent! Yes, as of Volta 0.7.0 the Volta command is now on the PATH, so referencing it from scripts works as expected.

@charlespierce
Copy link
Contributor Author

Another vote for this / use-case brought up in #931 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants