mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Always use \n when passing to Jupyter (#14185)
This commit is contained in:
@@ -9,7 +9,6 @@ import * as fs from 'fs-extra';
|
|||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { EOL } from 'os';
|
|
||||||
import * as utils from '../common/utils';
|
import * as utils from '../common/utils';
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
@@ -364,15 +363,15 @@ export class JupyterSession implements nb.ISession {
|
|||||||
let allCode: string = '';
|
let allCode: string = '';
|
||||||
// Ensure cwd matches notebook path (this follows Jupyter behavior)
|
// Ensure cwd matches notebook path (this follows Jupyter behavior)
|
||||||
if (this.path && path.dirname(this.path)) {
|
if (this.path && path.dirname(this.path)) {
|
||||||
allCode += `%cd ${path.dirname(this.path)}${EOL}`;
|
allCode += `%cd ${path.dirname(this.path)}\n`;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < Object.keys(process.env).length; i++) {
|
for (let i = 0; i < Object.keys(process.env).length; i++) {
|
||||||
let key = Object.keys(process.env)[i];
|
let key = Object.keys(process.env)[i];
|
||||||
if (key.toLowerCase() === 'path' && this._pythonEnvVarPath) {
|
if (key.toLowerCase() === 'path' && this._pythonEnvVarPath) {
|
||||||
allCode += `%set_env ${key}=${this._pythonEnvVarPath}${EOL}`;
|
allCode += `%set_env ${key}=${this._pythonEnvVarPath}\n`;
|
||||||
} else {
|
} else {
|
||||||
// Jupyter doesn't seem to alow for setting multiple variables at once, so doing it with multiple commands
|
// Jupyter doesn't seem to alow for setting multiple variables at once, so doing it with multiple commands
|
||||||
allCode += `%set_env ${key}=${process.env[key]}${EOL}`;
|
allCode += `%set_env ${key}=${process.env[key]}\n`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user