4

Everytime I deploy a function, I have the annoyance that I need to answer the question:

The following functions are found in your project but do not exist in your local source code

with "No".

I have the following structure of my functions. I have a folder with the Typescript functions and then a different folder with the Javascript functions. They are in separate folders, because I am too dumb to get it to work in the same folder.

I initially created both folders using the Firebase CLI and choosing Typescript and Javascript respectively.

I am aware of the --force operator, but I think it will force "Yes" and I don't want the functions to be deleted.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
Spurious
  • 1,903
  • 5
  • 27
  • 53

1 Answers1

5

As detailed in the documentation:

You could only target the specific functions you want to deploy, like:

$ firebase deploy --only functions:function1,functions:function2

Or you could group your Cloud Functions into export groups in your index.js/index.ts files.

Grouping functions allows you to deploy multiple functions using a single command.

See the same doc for more detail.


And yes, the --force operator bypasses the confirmation prompt, but it is the confirmation prompt for deletion, not for deployment (the --force operator is to be used with functions:delete). Therefore it will not help in your case.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
  • First of all, thanks for your reply. I know that I could get it done this way. I still think it is an annoyance for me to get it done this way. Grouping of functions is a use case that I would want to use for a similar, related number of functions. If you have dozens of functions in your folder, you end up having more than one group and the entire thing starts from the beginning. In any case, it seems like the functionality does not exist. – Spurious Nov 14 '19 at 10:46