Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Conversation

@chadian
Copy link

@chadian chadian commented Sep 18, 2020

There is a need in the heroku cli to be able to change the location of the netrc file location without changing the home directory. This follows the same design as mentioned here:

It generally resides in the user’s home directory, but a location outside of the home directory can be set using the environment variable NETRC

@jdxcode What do you think about adding this feature?

@chadian
Copy link
Author

chadian commented Sep 18, 2020

Not sure why tests are failing, locally only two gpg tests were failing cause I don't think I have it setup right, but the rest passed.

@jdx
Copy link
Owner

jdx commented Sep 18, 2020

do you guys want to take over the maintenance of this package?

@weslord
Copy link

weslord commented Mar 8, 2022

I'm sure OP has found a workaround by now, but in case anyone else comes across this thread and wonders (like I did) how to use the NETRC environment variable with this library, you can set a file path explicitly in the constructor:

const Netrc = require('netrc-parser').Netrc
const netrc = new Netrc(process.env.NETRC)

@weslord
Copy link

weslord commented Mar 8, 2022

Also, anyone who had this experience:

Not sure why tests are failing, locally only two gpg tests were failing cause I don't think I have it setup right, but the rest passed.

GPG needs the key in test/fixtures/gpg.key, you can import it to your keyring with

gpg --import test/fixtures/gpg.key

If you want to delete it when you're done,

gpg --delete-secret-keys node-netrc-parser-test
gpg --delete-keys node-netrc-parser-test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants