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

Add update command #89

Open
8 tasks
drpaneas opened this issue Nov 1, 2020 · 0 comments
Open
8 tasks

Add update command #89

drpaneas opened this issue Nov 1, 2020 · 0 comments
Milestone

Comments

@drpaneas
Copy link
Collaborator

drpaneas commented Nov 1, 2020

Scenario
A user wants refresh the local metadata (e.g. fetch any links (or replace broken links) since the last scrape). These metadata will be stored into a file locally (e.g. by default ~/.romie/db.json) acting as a database. The file's location should be specified into the configuration file (e.g. ~/.romie/romie.conf).

User Story
Given you have a configuration file, when you type romie update, then it will update your metadata.

Acceptance Criteria

  • Use the Cobra framework to create a romie update command.
  • Check if the configuration file exists. If the configuration file doesn't exist, it will error and exit.
  • Read a configuration file that will have a default location of the database file
  • Introduce a flag that the user will able to override the configuration file and point his own location of the db file.
  • Implement the necessary error checks (e.g. if the given location doesn't exit)
  • Write unit tests
  • Write functional tests
  • Implement help for the command

Optional: Use the https://github.com/spf13/afero for filesystem abstraction

Hints

  • If the checking for the configuration file has not been implemented in the codebase yet, just create a file by yourself on your system, so you can work on this ticket.

  • If there are no metadata implemented in the codebase, just read the configuration file and make sure there is an entry for the database file and this file is accessible (read and write permissions).

@drpaneas drpaneas modified the milestones: Scrape, CLI Nov 1, 2020
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