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
5 changes: 4 additions & 1 deletion firebase-vscode/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ export async function registerCore(
return;
}
const workspaceFolder = vscode.workspace.workspaceFolders[0];
const initCommand = currentProjectId.value ?
`${settings.firebasePath} init dataconnect --project ${currentProjectId.value}` :
`${settings.firebasePath} init dataconnect`;
vscode.tasks.executeTask(
new vscode.Task(
{ type: "shell" }, // this is the same type as in tasks.json
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 --project ${currentProjectId.value}`),
new vscode.ShellExecution(initCommand),
),
);
});
Expand Down
5 changes: 4 additions & 1 deletion firebase-vscode/src/data-connect/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ 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} -P ${currentProjectId.value}`);
if (currentProjectId.value) {
command = `${command} --project ${currentProjectId.value}`;
}
terminal.sendText(command);
}

export function runTerminalTask(
Expand Down