use addtionalEnvironmentVariables (#8123)

This commit is contained in:
Alan Ren
2019-10-30 15:02:30 -07:00
committed by GitHub
parent 9eb319f392
commit 836bf1d28a

View File

@@ -79,11 +79,15 @@ export class NotebookService implements INotebookService {
const workingDirectory = this.platformService.storagePath(); const workingDirectory = this.platformService.storagePath();
const notebookFullPath = path.join(workingDirectory, fileName); const notebookFullPath = path.join(workingDirectory, fileName);
const outputFullPath = path.join(workingDirectory, `output-${fileName}`); const outputFullPath = path.join(workingDirectory, `output-${fileName}`);
const additionalEnvironmentVariables: NodeJS.ProcessEnv = env || {};
// Set the azdata eula
// Scenarios using the executeNotebook feature already have the EULA acceptted by the user before executing this.
additionalEnvironmentVariables['ACCEPT_EULA'] = 'yes';
try { try {
await this.platformService.saveTextFile(content, notebookFullPath); await this.platformService.saveTextFile(content, notebookFullPath);
await this.platformService.runCommand(`azdata notebook run --path "${notebookFullPath}" --output-path "${workingDirectory}" --timeout -1`, await this.platformService.runCommand(`azdata notebook run --path "${notebookFullPath}" --output-path "${workingDirectory}" --timeout -1`,
{ {
additionalEnvironmentVariables: env, additionalEnvironmentVariables: additionalEnvironmentVariables,
workingDirectory: workingDirectory workingDirectory: workingDirectory
}); });
return { return {