Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions firebase-vscode/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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}`),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this guaranteed to be non-empty when the init button is shown? I thought there's a project selection prompt in the CLI or something

),
);
});
Expand Down
5 changes: 3 additions & 2 deletions firebase-vscode/src/data-connect/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> = {};

Expand All @@ -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}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use the long form --project for consistency and readability?

}

export function runTerminalTask(
Expand Down Expand Up @@ -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}`,
);
});

Expand Down