I need to pull down my code from a firebase hosted site, I created a site this past summer and no longer have the code locally on my laptop. I would like to recode some of the pieces, but don't have the source code anymore (other than the javascript and css I can glean from the served pages). I can't find a way to get the code from the firebase site, does anyone have any ideas?
Here's how to roll back: In the Firebase console, in the Release History table for your site, hover over the previous release entry that you want to roll back to. Click more_vert, then select Roll back.
Firebase automatically creates your firebase. json file at the root of your project directory when you run the firebase init command.
You should of course add your own version control (e.g. git) to manage your revisions and backups so this doesn't occur.
There is a script you can run to download all the assets using the CLI. You can find the script and instructions here. It can also be run using npx:
npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
Note that this only returns the compiled/rendered content from the specified public folder and not any precompiled source you may have had on the development machine.
Since your files are static assets, you could also scrape them using wget. This is inferior for advanced apps as you'll get the rendered content and not the source:
wget -r -np https://<YOURAPPNAME>.firebaseapp.com
Read more on scraping web sites here: https://apple.stackexchange.com/questions/100570/getting-files-all-at-once-from-a-web-page-using-curl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With