Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions predeploy script exits silently if it contains an = sign #5596

Closed
valeriangalliat opened this issue Mar 14, 2023 · 1 comment
Closed

Comments

@valeriangalliat
Copy link

[REQUIRED] Environment info

firebase-tools: 11.24.1

Platform: macOS

[REQUIRED] Test case

In firebase.json:

{
  "functions": {
    "predeploy": [
      "echo a=b && echo hello"
    ]
}

[REQUIRED] Steps to reproduce

firebase deploy --only functions

[REQUIRED] Expected behavior

Before deploying, it echoes a=b then hello on the next line.

[REQUIRED] Actual behavior

i  deploying functions
Running command: echo a=b && echo hello
✔  functions: Finished running predeploy script.

Logging translatedCommand here gives the following:

"/path/to/node" "/path/to/node_modules/cross-env/dist/bin/cross-env-shell.js" "echo a=b && echo hello"

Which brings us to npx cross-env-shell "echo a=b && echo hello" not running the command as expected.

Turns out this is tracked in kentcdodds/cross-env#246 but sadly cross-env is no more maintained and has been archived, which means this won't be fixed there.

It seems that if we want Firebase to not silently break when a predeploy command includes an = sign, we need to use something else than cross-env to run the script.

@taeold
Copy link
Contributor

taeold commented Mar 15, 2023

Thanks for raising the issue @valeriangalliat!

Going to mark this as duplicate of #5339.

We also don't have too much resource at hand to address this issue atm. It looks like more users are getting tripped up with the limitation - let me see if we can at least output a useful error message...

@taeold taeold closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants