通过CLI或其他方式将单个文件上传到Firebase托管,而不删除现有文件? [英] Upload single file to firebase hosting via CLI or other without deleting existing ones?

查看:79
本文介绍了通过CLI或其他方式将单个文件上传到Firebase托管,而不删除现有文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

如何在不删除现有文件的情况下将单个文件上传到Firebase?

How to upload a single file to firebase without deleting existing files?

详细信息:

  • 目的:上传单个文件而不删除服务器上的现有文件

  • Intent: upload single file without deleting existing files on server

用法::本地计算机上有单独的目录,每个目录都上传到服务器上的特定文件夹

Usage: have separate directories on local machine each uploading to a specific folder on server

我尝试过的操作:使用firebase deploy -p file.txt覆盖了公共目录,这导致将根公共目录设置为使用该目录.

What I've tried: overriding the public dir with firebase deploy -p file.txt, this results in setting root public dir to use that dir.

推荐答案

披露:我在Firebase工作

Firebase托管的命令行工具当前要求您在本地拥有整个网站,即使它仅上载自上次部署以来已修改的文件.

Firebase hosting's command line tools currently requires that you have the entire web site locally, even though it will only upload the files that were modified since the last deploy.

因此,唯一的解决方法是只有一台计算机来存放所有这些目录,例如诸如构建服务器或登台服务器之类的东西.

So your only workaround for not would be to have a single machine where all those directories exist, e.g. something like a build or staging server.

我们知道,这限制了它可用于的案件数量.

We are aware that this is limiting the number of cases that it can be used for.

更新(2018年12月):Firebase Hosting现在具有REST API.尽管这仍然不能正式允许您部署单个文件,但是您可以创造性地使用它来获取所需的文件.在此处查看我的要点: https://gist.github.com/puf/e00c34dd82b35c56e91adbc3a9b1c412

Update (December 2018): Firebase Hosting now has a REST API. While this still doesn't officially allow you to deploy a single file, you can use it creatively to get what you want. See my Gist here: https://gist.github.com/puf/e00c34dd82b35c56e91adbc3a9b1c412

这篇关于通过CLI或其他方式将单个文件上传到Firebase托管,而不删除现有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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