File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
import * as Types from './types' ;
2
2
import * as vscode from 'vscode' ;
3
+ import * as Path from 'path' ;
3
4
4
5
/**
5
6
* An interface for a JavaScript object that
@@ -131,11 +132,13 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
131
132
132
133
export class SystemVariables extends AbstractSystemVariables {
133
134
private _workspaceRoot : string ;
135
+ private _workspaceRootFolderName : string ;
134
136
private _execPath : string ;
135
137
136
138
constructor ( ) {
137
139
super ( ) ;
138
140
this . _workspaceRoot = vscode . workspace . rootPath ;
141
+ this . _workspaceRootFolderName = Path . basename ( this . _workspaceRoot ) ;
139
142
Object . keys ( process . env ) . forEach ( key => {
140
143
this [ `env.${ key } ` ] = process . env [ key ] ;
141
144
} ) ;
@@ -148,4 +151,8 @@ export class SystemVariables extends AbstractSystemVariables {
148
151
public get workspaceRoot ( ) : string {
149
152
return this . _workspaceRoot ;
150
153
}
154
+
155
+ public get workspaceRootFolderName ( ) : string {
156
+ return this . _workspaceRootFolderName ;
157
+ }
151
158
}
You can’t perform that action at this time.
0 commit comments