forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcurrentProcess.ts
More file actions
31 lines (28 loc) · 907 Bytes
/
currentProcess.ts
File metadata and controls
31 lines (28 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { injectable } from 'inversify';
import { ICurrentProcess } from '../types';
import { EnvironmentVariables } from '../variables/types';
@injectable()
export class CurrentProcess implements ICurrentProcess {
public on = (event: string | symbol, listener: Function): this => {
process.on(event as any, listener as any);
return process as any;
};
public get env(): EnvironmentVariables {
return process.env as any as EnvironmentVariables;
}
public get argv(): string[] {
return process.argv;
}
public get stdout(): NodeJS.WriteStream {
return process.stdout;
}
public get stdin(): NodeJS.ReadStream {
return process.stdin;
}
public get execPath(): string {
return process.execPath;
}
}