Skip to content

Commit 4cd138c

Browse files
committed
Revert chantes for #1736
This PR revert changes for #1736. Signed-off-by: Denis Golovin [email protected]
1 parent 63171c6 commit 4cd138c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/odo.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -761,22 +761,16 @@ export class OdoImpl implements Odo {
761761
return services;
762762
}
763763

764-
public createEnv(): {} {
765-
const env = {...process.env };
766-
env.GLOBALODOCONFIG = path.resolve(__dirname,'..', '..', 'config', 'preference.yaml');
767-
return env;
768-
}
769-
770764
public async executeInTerminal(command: CommandText, cwd: string = process.cwd(), name = 'OpenShift'): Promise<void> {
771765
const [cmd] = `${command}`.split(' ');
772766
const toolLocation = await ToolsConfig.detect(cmd);
773-
const terminal: Terminal = WindowUtil.createTerminal(name, cwd, this.createEnv());
767+
const terminal: Terminal = WindowUtil.createTerminal(name, cwd);
774768
terminal.sendText(toolLocation === cmd ? `${command}` : `${command}`.replace(cmd, `"${toolLocation}"`), true);
775769
terminal.show();
776770
}
777771

778772
public async execute(command: CommandText, cwd?: string, fail = true, addEnv = {}): Promise<cliInstance.CliExitData> {
779-
const env = this.createEnv();
773+
const env = {...process.env };
780774
const commandActual = `${command}`;
781775
const commandPrivacy = `${command.privacyMode(true)}`;
782776
const [cmd] = commandActual.split(' ');
@@ -1032,7 +1026,7 @@ export class OdoImpl implements Odo {
10321026

10331027
async loadWorkspaceComponents(event: WorkspaceFoldersChangeEvent): Promise<void> {
10341028
const clusters = (await this.getClusters());
1035-
if(!clusters || clusters.length === 0) return;
1029+
if(!clusters) return;
10361030
if (event === null && workspace.workspaceFolders || event && event.added && event.added.length > 0) {
10371031
const addedFolders = event === null? workspace.workspaceFolders : event.added;
10381032
await OdoImpl.data.addContexts(addedFolders);

test/unit/odo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ suite('odo', () => {
8989
const cwd = 'path/to/some/dir';
9090
await odoCli.execute(command, cwd);
9191

92-
expect(execStub).calledOnceWith(`${command}`, { cwd, env: (odo.getInstance() as odo.OdoImpl).createEnv() });
92+
expect(execStub).calledOnceWith(`${command}`, { cwd, env: process.env });
9393
});
9494

9595
test('execute rejects if an error occurs in the shell command', async () => {

0 commit comments

Comments
 (0)