alphapapa / pocket-lib.el

Emacs library for the getpocket.com API
GNU General Public License v3.0
21 stars 5 forks source link

pocket-lib--save-access-token doesn't create parent directories #3

Closed repelliuss closed 3 months ago

repelliuss commented 3 years ago

with-temp-file in pocket-lib--save-access-token errors if file's directory does not exist. I encountered this issue in your pocket reader package. This leads an error to

pocket-lib--authorize: Opening output file: No such file or directory, c:/msys64/home/repelliuss/.cache/emacs-pocket-lib-token.json

on second call to pocket-reader which is not obvious as after authorizing you think pocket-reader couldn't authorize and therefore couldn't create the file but the actual problem is .cache directory doesn't exist.

It may not be common in Linux systems but I also use MSYS2 environment so it may be a good idea to make sure ~/.cache directory exists or even ask to create it.

alphapapa commented 3 years ago

Thanks.

alphapapa commented 3 months ago

Fixed in https://github.com/alphapapa/pocket-lib.el/commit/c2bddd6b1392741462fff2b9b119e6775d3c2bc7