mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* saving untested work * fixes for #8165 and #8167 * minor fixes * fix for #8260 * minor quoting fixes * fix for #8264 * minor fixes * minor fixes. * move tools constants to their own files * remove execution cell results from notebooks. * remove extraneous changes * move ensuring of StoragePath to platformservice * remove fix for #8264 pending pm input
This commit is contained in:
@@ -16,16 +16,22 @@ export function getDateTimeString(): string {
|
||||
return new Date().toISOString().slice(0, 19).replace(/[^0-9]/g, ''); // Take the date time information and only leaving the numbers
|
||||
}
|
||||
|
||||
|
||||
export function getRuntimeBinaryPathEnvironmentVariableName(toolName: string): string {
|
||||
return `${NoteBookEnvironmentVariablePrefix}${toolName.toUpperCase().replace(/ |-/g, '_')}`;
|
||||
}
|
||||
|
||||
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 => {
|
||||
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, '_')}`;
|
||||
const envVarName = getRuntimeBinaryPathEnvironmentVariableName(t.name);
|
||||
process.env[envVarName] = t.installationPath;
|
||||
installationPaths.add(path.resolve(path.dirname(t.installationPath)));
|
||||
installationPaths.add(path.dirname(t.installationPath));
|
||||
console.log(`setting env var:'${envVarName}' to: '${t.installationPath}'`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user