DEV Community

Discussion on: Introducing a new tool - How to back your DEV Post

Collapse
 
andypiper profile image
Andy Piper • Edited

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.

Collapse
 
dhairyashah profile image
Dhairya Shah

Thank you for feedback!
code is now public - github.com/codewithsnowbit/dev-backup

Feel free to contribute in the project 🙂

Collapse
 
andypiper profile image
Andy Piper

I'll take a look, thanks for sharing!

Thread Thread
 
dhairyashah profile image
Dhairya Shah

Sure!

Collapse
 
dhairyashah profile image
Dhairya Shah

managed to fix some of your suggested issues.

Thank you!