Skip to content

Commit ff7cbf2

Browse files
authored
Merge pull request #525 from skilliscode/master
Add support for workspaceRootFolderName variable in pythonPath
2 parents 06c42ea + ea9d580 commit ff7cbf2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/client/common/systemVariables.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as Types from './types';
22
import * as vscode from 'vscode';
3+
import * as Path from 'path';
34

45
/**
56
* An interface for a JavaScript object that
@@ -131,11 +132,13 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
131132

132133
export class SystemVariables extends AbstractSystemVariables {
133134
private _workspaceRoot: string;
135+
private _workspaceRootFolderName: string;
134136
private _execPath: string;
135137

136138
constructor() {
137139
super();
138140
this._workspaceRoot = vscode.workspace.rootPath;
141+
this._workspaceRootFolderName = Path.basename(this._workspaceRoot);
139142
Object.keys(process.env).forEach(key => {
140143
this[`env.${key}`] = process.env[key];
141144
});
@@ -148,4 +151,8 @@ export class SystemVariables extends AbstractSystemVariables {
148151
public get workspaceRoot(): string {
149152
return this._workspaceRoot;
150153
}
154+
155+
public get workspaceRootFolderName(): string {
156+
return this._workspaceRootFolderName;
157+
}
151158
}

0 commit comments

Comments
 (0)