从Firebase托管部署中提取丢失的代码 [英] Pull lost code from Firebase Hosting deployment

查看:73
本文介绍了从Firebase托管部署中提取丢失的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从一个Firebase托管站点中提取我的代码,去年夏天我创建了一个站点,并且不再在笔记本电脑上本地存储代码.我想重新编码一些片段,但没有源代码了(除了JavaScript和CSS之外,我可以从所提供的页面中进行收集).我找不到从Firebase网站获取代码的方法,有人有任何想法吗?

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?

推荐答案

您当然应该添加自己的版本控制(例如git)来管理您的修订和备份,这样就不会发生.

You should of course add your own version control (e.g. git) to manage your revisions and backups so this doesn't occur.

有一个脚本可以运行,以使用CLI下载所有资产.您可以在此处找到该脚本和说明.也可以使用npx来运行它:

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>

由于文件是静态资产,因此您也可以使用wget对其进行抓取.对于高级应用程序来说,这是次等的,因为您将获得渲染的内容而不是源代码:

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

这篇关于从Firebase托管部署中提取丢失的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆