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

The tool breaks if the config file is empty #1

Open
WilliamMcCumstie opened this issue Mar 21, 2019 · 1 comment
Open

The tool breaks if the config file is empty #1

WilliamMcCumstie opened this issue Mar 21, 2019 · 1 comment

Comments

@WilliamMcCumstie
Copy link
Contributor

WilliamMcCumstie commented Mar 21, 2019

If the config exists but is empty, it loads as false instead of an empty hash. This causes the entire app to break:

[~/Documents/flight-account]$ bin/flight-account login --trace

  'o`
 'ooo`                        Alces Flight account management
 `oooo`                                  v1.0.2 -- 2018-05-30
  `oooo`         'o`
    `ooooo`  `ooooo
       `oooo:oooo`
          `v  -[ alces flight ]-

To sign in to your Alces Flight account please enter your username and
password.

Username: (william) %
[~/Documents/flight-account]$ touch ~/.config/flight/accounts/config.yml
[~/Documents/flight-account]$ bin/flight-account login --trace
/home/william/Documents/flight-account/lib/alces/account/config.rb:36:in `auth_token': undefined method `[]' for false:FalseClass (NoMethodError)
        from /home/william/Documents/flight-account/lib/alces/account/commands/account.rb:131:in `login'
        from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/commander-4.4.5/lib/commander/command.rb:183:in `call'
        from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/commander-4.4.5/lib/commander/command.rb:153:in `run'
        from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/commander-4.4.5/lib/commander/runner.rb:446:in `run_active_command'
        from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/commander-4.4.5/lib/commander/runner.rb:68:in `run!'
        from /usr/share/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/commander-4.4.5/lib/commander/delegates.rb:15:in `run!'
        from /home/william/Documents/flight-account/lib/alces/account/cli.rb:35:in `run'
        from bin/flight-account:15:in `<main>'
@WilliamMcCumstie
Copy link
Contributor Author

This has probably been fixed with the update to FlightConfig. To be confirmed

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

No branches or pull requests

1 participant