erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

No hex config written when registering #2

Closed kellymclaughlin closed 9 years ago

kellymclaughlin commented 9 years ago

I registered a new hex account and received the confirmation email as expected, but no hex configuration was written. Glancing over the source, the only place I see a call to rebar3_hex_config:write is in the deauth function.

Here is the output of a few commands after I completed registration and confirm via email.

$ ./rebar3 hex user whoami
 $ ./rebar3 hex config username
username: 

Shouldn't the register process write a config or is writing a config file expected to be a manual step?

tsloughter commented 9 years ago

Hm, weird, it should be done here https://github.com/tsloughter/rebar3_hex/blob/master/src/rebar3_hex_user.erl#L170

kellymclaughlin commented 9 years ago

Oh, I bet the call to file:write_file returned an {error, enoent} because I don't have a .hex directory in my $HOME.

tsloughter commented 9 years ago

Argh, yea, my bad. I'll add a ensure_dir and match on ok for write.

tsloughter commented 9 years ago

Updated. You should be able to get a config with rebar3 hex user auth though.

kellymclaughlin commented 9 years ago

Yep, that works. Thanks!