mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
notebook background execution (#8079)
* notebook background execution * code review comments * comments 2 * more logging
This commit is contained in:
@@ -17,16 +17,21 @@ export function getDateTimeString(): string {
|
||||
}
|
||||
|
||||
export function setEnvironmentVariablesForInstallPaths(tools: ITool[]): void {
|
||||
// Use Set class to make sure the collection only contains unique values.
|
||||
let installationPaths: Set<string> = new Set<string>();
|
||||
tools.forEach(t => {
|
||||
// construct an env variable name with NoteBookEnvironmentVariablePrefix prefix
|
||||
// and tool.name as suffix, making sure of using all uppercase characters and only _ as separator
|
||||
const envVarName: string = `${NoteBookEnvironmentVariablePrefix}${t.name.toUpperCase().replace(/ |-/, '_')}`;
|
||||
process.env[envVarName] = t.installationPath;
|
||||
installationPaths.add(path.resolve(path.dirname(t.installationPath)));
|
||||
console.log(`setting env var:'${envVarName}' to: '${t.installationPath}'`);
|
||||
if (t.installationPath) {
|
||||
// construct an env variable name with NoteBookEnvironmentVariablePrefix prefix
|
||||
// and tool.name as suffix, making sure of using all uppercase characters and only _ as separator
|
||||
const envVarName: string = `${NoteBookEnvironmentVariablePrefix}${t.name.toUpperCase().replace(/ |-/g, '_')}`;
|
||||
process.env[envVarName] = t.installationPath;
|
||||
installationPaths.add(path.resolve(path.dirname(t.installationPath)));
|
||||
console.log(`setting env var:'${envVarName}' to: '${t.installationPath}'`);
|
||||
}
|
||||
});
|
||||
const envVarToolsInstallationPath: string = [...installationPaths.values()].join(path.delimiter);
|
||||
process.env[ToolsInstallPath] = envVarToolsInstallationPath;
|
||||
console.log(`setting env var:'${ToolsInstallPath}' to: '${envVarToolsInstallationPath}'`);
|
||||
if (installationPaths.size > 0) {
|
||||
const envVarToolsInstallationPath: string = [...installationPaths.values()].join(path.delimiter);
|
||||
process.env[ToolsInstallPath] = envVarToolsInstallationPath;
|
||||
console.log(`setting env var:'${ToolsInstallPath}' to: '${envVarToolsInstallationPath}'`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user