tnahs / readstor

A CLI for Apple Books annotations
https://tnahs.github.io/readstor/
Apache License 2.0
16 stars 1 forks source link

Wrong default template location #3

Closed lucidyan closed 2 years ago

lucidyan commented 2 years ago

Source: brew

Version: 0.1.2

Steps to reproduce:

~/.readstor ❯ readstor -v                                                                                                                                                                                                     22:17:59
Error: ReadStor failed while parsing template

Caused by:
    0: Couldn't open template '"/Users/shant/Workspace/repos/readstor/templates/default.txt"'
    1: No such file or directory (os error 2)

Expected behavior: Default template should be placed and linked to the ~/.readstor/templates/

tnahs commented 2 years ago

Oh this is a terribly rookie mistake. The default template isn't bundled into the binary but referred to by its path. I'll need to rework a few things to make this work with the default template. It never caused an issue running tests locally cause I always had the file in the right place. And the binary asked for it at the path you gave so it never caused a crash for me.

For the time being if you download the default template found here, or create your own and run it with readstor --template /path/to/template.txt it should work.

Default template should be placed and linked to the ~/.readstor/templates/

This is actually what I plan on implementing in the future if you look at 1.x Target. The current version supports only a single template and no default templates directory.

tnahs commented 2 years ago

I just pushed a new branch: v0.2.0 that fixes this issue. Need to address a few more things before I push a release. You're welcome to test it out before then.