Skip to content

Commit

Permalink
Fix issue where the VS Code extension outputs a false positive warnin…
Browse files Browse the repository at this point in the history
…g message (#7915)

* Fix issue where the VS Code extension outputs a false positive warning message

* changelog

---------

Co-authored-by: Harold Shen <hlshen@google.com>
  • Loading branch information
aalej and hlshen authored Nov 7, 2024
1 parent da6056b commit 0446616
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

- [Fixed] Fixed an issue where Add data and Read data would generate operations in the wrong folder
- [Fixed] Fixed an issue where firebase version check produced false positives on Windows (#7910)

## 0.10.6

Expand Down
10 changes: 8 additions & 2 deletions firebase-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ async function checkCLIInstallation(): Promise<void> {
"latest"
];
const env = { ...process.env, VSCODE_CWD: "" };
const versionRes = spawnSync("firebase", ["--version"], { env });
const versionRes = spawnSync("firebase", ["--version"], {
env,
shell: process.platform === "win32",
});
const currentVersion = semver.valid(versionRes.stdout?.toString());
const npmVersionRes = spawnSync("npm", ["--version"]);
const npmVersionRes = spawnSync("npm", ["--version"], {
env,
shell: process.platform === "win32",
});
const npmVersion = semver.valid(npmVersionRes.stdout?.toString());
if (!currentVersion) {
message = `The Firebase CLI is not installed (or not available on $PATH). If you would like to install it, run ${
Expand Down

0 comments on commit 0446616

Please sign in to comment.