I can see how this could be a really useful tool for some people.
I noticed a few issues:
if the repository you specify for saving to does not exist, the backup fails, but the front-end reports that it was a success. The JS console shows the 404 error for the repository, though. There's no guidance text to say that the repository must already exist, the success message is not accurate, and no way to have the code create one without extending the PAT scopes.
this only backs up the markdown content of the post, not any attached media.
the file does not have a very identifiable name in the GitHub repository.
Also, I have some suggestions!
allow the repository to be created
allow this to backup all of my posts, not one-by-one (maybe use the Forem API, I don't know what the code is doing currently)
Maybe if you share the code on Gitlab or GitHub, others could help you out with some of these ideas.
I can see how this could be a really useful tool for some people.
I noticed a few issues:
Also, I have some suggestions!
Maybe if you share the code on Gitlab or GitHub, others could help you out with some of these ideas.
Thank you for feedback!
code is now public - github.com/codewithsnowbit/dev-backup
Feel free to contribute in the project 🙂
I'll take a look, thanks for sharing!
Sure!
managed to fix some of your suggested issues.
Thank you!