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/postdeploy do not work when contains = #5339

Closed
aaharu opened this issue Dec 15, 2022 · 2 comments · Fixed by #6503
Closed

functions predeploy/postdeploy do not work when contains = #5339

aaharu opened this issue Dec 15, 2022 · 2 comments · Fixed by #6503

Comments

@aaharu
Copy link

aaharu commented Dec 15, 2022

[REQUIRED] Environment info

firebase-tools: 11.18.0

Platform: macOS

[REQUIRED] Test case

// firebase.json
{
  "functions": {
    "predeploy": "npm run build --workspace=packages/foobar",  // NG
    // "predeploy": "npm run build --workspace packages/foobar", // OK
    // "predeploy": "npm run build --workspace\\=packages/foobar", // OK
    // "predeploy": "npm run build -w packages/foobar", // OK
    // "predeploy": "npm --prefix \"$RESOURCE_DIR\" run build", // OK
    "source": "packages/foobar"
  }
}
$ firebase deploy --only functions

=== Deploying to '---'...

i  deploying functions
Running command: npm run build --workspace=packages/foobar
✔  functions: Finished running predeploy script.

It outputs Finished running predeploy script., but the predeploy was not running.
This behavior seems to be caused by cross-env-shell.

[REQUIRED] Steps to reproduce

Add predeploy script that contains = to firebase.json.

[REQUIRED] Expected behavior

The predeploy and postdeploy scripts have finished running.

[REQUIRED] Actual behavior

@aaharu aaharu added the bug label Dec 15, 2022
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@taeold
Copy link
Contributor

taeold commented Jan 19, 2023

@aaharu Thanks for bringing this to our attention. I wasn't aware of that limitation in cross-env package.

kentcdodds/cross-env#246

Looks like cross-env package is depreacted, and the work needed to fix this bug might amount to - "rewrite cross-env" :(. Frankly, that isn't something I can prioritize on, but if we see that many users are having similar problem we'll definitely revisit earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants