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

Migrate installed skills file to XDG Base Directory #88

Merged
merged 2 commits into from
Jan 21, 2021
Merged

Migrate installed skills file to XDG Base Directory #88

merged 2 commits into from
Jan 21, 2021

Conversation

PureTryOut
Copy link
Contributor

@PureTryOut PureTryOut commented Dec 8, 2020

Description

Combined with MycroftAI/mycroft-core#2578
~/.mycroft/skills.json is now migrated to follow the XDG Base Directory
specification.

This means it'll be installed to $XDG_DATA_HOME/mycroft/skills.json,
or $HOME/.local/share/mycroft/skills.json if $XDG_DATA_HOME is unset

The file is migrated from the old location if it still exists there

Type of PR

  • Bugfix
  • Feature implementation
  • Refactor of code (without functional changes)
  • Documentation improvements
  • Test improvements

Testing

Run MSM at least once without this PR and without MycroftAI/mycroft-core#2578 and make sure ~/.mycroft/skills.json exists.

Then run MyCroft and MSM with MycroftAI/mycroft-core#2578 and this PR, and verify that ~/.mycroft/skills.json has been moved to ~/.local/share/mycroft/skills.json (assuming you haven't changed $XDG_DATA_HOME) and that everything still works correctly as before.

Documentation

No documentation updates are needed

@forslund
Copy link
Collaborator

I also noticed that the pyxdg is only in requirements and not in setup.py

msm/skill_state.py Outdated Show resolved Hide resolved
@forslund
Copy link
Collaborator

Suggested fix for the mocking issue: https://github.com/forslund/mycroft-skills-manager/tree/PureTryOut-xdg-config

Copy link
Collaborator

@forslund forslund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed a tiny change to get it working, but apart from the comments it seems to work well.

msm/skill_state.py Outdated Show resolved Hide resolved
msm/skill_state.py Outdated Show resolved Hide resolved
msm/skill_state.py Outdated Show resolved Hide resolved
PureTryOut and others added 2 commits January 20, 2021 21:21
Combined with MycroftAI/mycroft-core#2578
~/.mycroft/skills.json is now migrated to follow the XDG Base Directory
specification.

This means it'll be installed to $XDG_DATA_HOME/mycroft/skills.json,
or $HOME/.local/share/mycroft/skills.json if $XDG_DATA_HOME is unset

The file is migrated from the old location if it still exists there
Copy link
Collaborator

@forslund forslund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's all I had, looks great now!

@krisgesling krisgesling merged commit 841f568 into MycroftAI:master Jan 21, 2021
@PureTryOut PureTryOut deleted the xdg-config branch January 21, 2021 07:27
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.

3 participants