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

fix(config): create-config-directory-recursive #683

Merged

Conversation

craicoverflow
Copy link
Contributor

@craicoverflow craicoverflow commented May 20, 2021

If the config directory does not exist already then an error is thrown as it is not recursively created while migrating the config from the old location.

Verification Steps

Backup your config directory: mv ~/.config ~/.config.bk

Run a rhoas command.

Before this change this would happen:

❯ ./rhoas whoami
Error migrating config file to new location: mkdir /home/ephelan/.config/rhoas: no such file or directorymkdir /home/ephelan/.config/rhoas: no such file or directory
❯ ./rhoas whoami
Error migrating config file to new location: mkdir /home/ephelan/.config/rhoas: no such file or directorymkdir /home/ephelan/.config/rhoas: no such file or directory
❯ cat ~/.config/rhoas/config.json

After:
```shell
❯ ./rhoas whoami
Error: not logged in. Run "rhoas login" to authenticate

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@craicoverflow craicoverflow changed the title fix/create-config-directory-recursive fix(config): create-config-directory-recursive May 20, 2021
@craicoverflow craicoverflow force-pushed the create-config-directory branch from 18c5ec8 to 9761e68 Compare May 20, 2021 14:22
@wtrocki wtrocki self-requested a review May 21, 2021 13:54
@wtrocki
Copy link
Collaborator

wtrocki commented May 21, 2021

Verified by changing location that doesn't exist. It was generated properly.

@wtrocki wtrocki merged commit f041037 into redhat-developer:main May 21, 2021
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

Successfully merging this pull request may close these issues.

2 participants