diff --git a/firebase-vscode/CHANGELOG.md b/firebase-vscode/CHANGELOG.md index 127047d7491..481a0d8a177 100644 --- a/firebase-vscode/CHANGELOG.md +++ b/firebase-vscode/CHANGELOG.md @@ -1,5 +1,9 @@ ## NEXT +- [Fixed] Fixed an issue where command would be executed against directory default project instead of the currently selected project. + +## 0.10.0 + - [Added] UI overhaul. - [Added] Added View Docs button to see generated documentation for your schema and connectors. - [Fixed] Improved detection for emulator start up and shut down. diff --git a/firebase-vscode/src/core/index.ts b/firebase-vscode/src/core/index.ts index e635ed546e2..6f3e5664e48 100644 --- a/firebase-vscode/src/core/index.ts +++ b/firebase-vscode/src/core/index.ts @@ -7,7 +7,7 @@ import { pluginLogger, LogLevel } from '../logger-wrapper'; import { getSettings } from "../utils/settings"; import { setEnabled } from "../../../src/experiments"; import { registerUser } from "./user"; -import { registerProject } from "./project"; +import { currentProjectId, registerProject } from "./project"; import { registerQuickstart } from "./quickstart"; import { registerOptions } from "../options"; import { upsertFile } from "../data-connect/file-utils"; @@ -61,7 +61,7 @@ export async function registerCore( workspaceFolder, // The workspace folder "firebase init dataconnect", // how you name the task "firebase init dataconnect", // Shows up as MyTask: name - new vscode.ShellExecution(`${settings.firebasePath} init dataconnect`), + new vscode.ShellExecution(`${settings.firebasePath} init dataconnect --project ${currentProjectId.value}`), ), ); }); diff --git a/firebase-vscode/src/data-connect/terminal.ts b/firebase-vscode/src/data-connect/terminal.ts index 2e49f44d126..10dcdb760aa 100644 --- a/firebase-vscode/src/data-connect/terminal.ts +++ b/firebase-vscode/src/data-connect/terminal.ts @@ -4,6 +4,7 @@ import vscode, { Disposable } from "vscode"; import { checkLogin } from "../core/user"; import { DATA_CONNECT_EVENT_NAME } from "../analytics"; import { getSettings } from "../utils/settings"; +import { currentProjectId } from "../core/project"; const environmentVariables: Record = {}; @@ -26,7 +27,7 @@ export function runCommand(command: string) { // TODO: This fails if the interactive shell is not expecting a command, such // as when oh-my-zsh asking for (Y/n) to updates during startup. // Consider using an non-interactive shell. - terminal.sendText(command); + terminal.sendText(`${command} -P ${currentProjectId.value}`); } export function runTerminalTask( @@ -81,7 +82,7 @@ export function registerTerminalTasks( // TODO: optional debug mode runTerminalTask( "firebase emulators", - `${settings.firebasePath} emulators:start`, + `${settings.firebasePath} emulators:start --project ${currentProjectId.value}`, ); });