Skip to content

Commit e11125f

Browse files
authored
Fix wrong project issue (#7752)
* Fix wrong project issue * Pr fixes
1 parent 26e55d2 commit e11125f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

firebase-vscode/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## NEXT
22

3+
- [Fixed] Fixed an issue where command would be executed against directory default project instead of the currently selected project.
4+
5+
## 0.10.0
6+
37
- [Added] UI overhaul.
48
- [Added] Added View Docs button to see generated documentation for your schema and connectors.
59
- [Fixed] Improved detection for emulator start up and shut down.

firebase-vscode/src/core/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pluginLogger, LogLevel } from '../logger-wrapper';
77
import { getSettings } from "../utils/settings";
88
import { setEnabled } from "../../../src/experiments";
99
import { registerUser } from "./user";
10-
import { registerProject } from "./project";
10+
import { currentProjectId, registerProject } from "./project";
1111
import { registerQuickstart } from "./quickstart";
1212
import { registerOptions } from "../options";
1313
import { upsertFile } from "../data-connect/file-utils";
@@ -61,7 +61,7 @@ export async function registerCore(
6161
workspaceFolder, // The workspace folder
6262
"firebase init dataconnect", // how you name the task
6363
"firebase init dataconnect", // Shows up as MyTask: name
64-
new vscode.ShellExecution(`${settings.firebasePath} init dataconnect`),
64+
new vscode.ShellExecution(`${settings.firebasePath} init dataconnect --project ${currentProjectId.value}`),
6565
),
6666
);
6767
});

firebase-vscode/src/data-connect/terminal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import vscode, { Disposable } from "vscode";
44
import { checkLogin } from "../core/user";
55
import { DATA_CONNECT_EVENT_NAME } from "../analytics";
66
import { getSettings } from "../utils/settings";
7+
import { currentProjectId } from "../core/project";
78

89
const environmentVariables: Record<string, string> = {};
910

@@ -26,7 +27,7 @@ export function runCommand(command: string) {
2627
// TODO: This fails if the interactive shell is not expecting a command, such
2728
// as when oh-my-zsh asking for (Y/n) to updates during startup.
2829
// Consider using an non-interactive shell.
29-
terminal.sendText(command);
30+
terminal.sendText(`${command} -P ${currentProjectId.value}`);
3031
}
3132

3233
export function runTerminalTask(
@@ -81,7 +82,7 @@ export function registerTerminalTasks(
8182
// TODO: optional debug mode
8283
runTerminalTask(
8384
"firebase emulators",
84-
`${settings.firebasePath} emulators:start`,
85+
`${settings.firebasePath} emulators:start --project ${currentProjectId.value}`,
8586
);
8687
});
8788

0 commit comments

Comments
 (0)