heroku / heroku-repo

Plugin for heroku CLI that can manipulate the repo
MIT License
682 stars 111 forks source link

Can't parse netrc with empty `login` #84

Closed jkutner closed 5 months ago

jkutner commented 5 years ago

This plugin can't parse .netrc files with entries in the form:

machine example.com
  login
  password xxxxx

Error is:

    at Lexer.char (~/.local/share/heroku/node_modules/netrc-parser/lib/netrc.js:44:11)
    at Lexer.lex (~/.local/share/heroku/node_modules/lex/lexer.js:86:41)
    at lex (~/.local/share/heroku/node_modules/netrc-parser/lib/netrc.js:74:24)
    at Netrc._parse (~/.local/share/heroku/node_modules/netrc-parser/lib/netrc.js:220:18)
    at new Netrc (~/.local/share/heroku/node_modules/netrc-parser/lib/netrc.js:166:10)
    at Object.token (~/.local/share/heroku/node_modules/heroku-repo/node_modules/heroku-cli-util/lib/auth.js:191:17)
    at run (~/.local/share/heroku/node_modules/heroku-repo/node_modules/heroku-cli-util/lib/command.js:158:38)
    at Object.run (~/.local/share/heroku/node_modules/heroku-repo/node_modules/heroku-cli-util/lib/command.js:171:12)
    at V5.run (~/.local/share/heroku/client/7.7.4/node_modules/@oclif/plugin-legacy/lib/index.js:118:26)
    at V5._run (~/.local/share/heroku/client/7.7.4/node_modules/@oclif/command/lib/command.js:29:31)
dmathieu commented 5 years ago

This seems to be an issue with the core CLI.

jkutner commented 5 years ago

I think it's the netrc-parser version in yarn.lock https://github.com/heroku/heroku-repo/blob/master/yarn.lock#L1132-L1136 (possibly overriding whats in core CLI?)

dmathieu commented 5 years ago

Which command are you using?