Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run a script from Firebase Functions Shell?

I've been using the Firebase Functions Shell (firebase experimental:functions:shell) and am finding it excellent for testing the firebase database and http listeners.

However it is a little annoying that I have to copy-paste test code in the shell.

Is there any way I can just write some js code in a file and then run the complete file with the Firebase shell? Without copying and pasting?

like image 617
Felipe Ferri Avatar asked Jan 28 '23 11:01

Felipe Ferri


1 Answers

Yes, send your script the the shell's stdin.

$ firebase experimental:functions:shell < tests.js

Taken from this blog.

You may still have to terminate the shell with ctl-C. Please file a bug report if you would like to see that change.

like image 138
Doug Stevenson Avatar answered Feb 13 '23 07:02

Doug Stevenson