Skip to content

Commit 1354dc3

Browse files
committed
Run 'odo push' for component in terminal
Fix #416.
1 parent 6e1dc69 commit 1354dc3

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function activate(context: vscode.ExtensionContext) {
3737
vscode.commands.registerCommand('openshift.component.describe', (context) => executeSync(Component.describe, context)),
3838
vscode.commands.registerCommand('openshift.component.create', (context) => execute(Component.create, context)),
3939
vscode.commands.registerCommand('openshift.component.delete.palette', (context) => execute(Component.del, context)),
40-
vscode.commands.registerCommand('openshift.component.push', (context) => execute(Component.push, context)),
40+
vscode.commands.registerCommand('openshift.component.push', (context) => executeSync(Component.push, context)),
4141
vscode.commands.registerCommand('openshift.component.watch', (context) => executeSync(Component.watch, context)),
4242
vscode.commands.registerCommand('openshift.component.log', (context) => executeSync(Component.log, context)),
4343
vscode.commands.registerCommand('openshift.component.followLog', (context) => executeSync(Component.followLog, context)),

src/openshift/component.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,10 @@ export class Component extends OpenShiftItem {
8787
Component.odo.executeInTerminal(`odo log ${context.getName()} -f --app ${app.getName()} --project ${project.getName()}`);
8888
}
8989

90-
static async push(context: OpenShiftObject): Promise<string> {
90+
static push(context: OpenShiftObject): void {
9191
const app: OpenShiftObject = context.getParent();
9292
const project: OpenShiftObject = app.getParent();
93-
94-
return Progress.execWithProgress({
95-
cancellable: false,
96-
location: vscode.ProgressLocation.Notification,
97-
title: `Pushing latest changes for component '${context.getName()}'`
98-
}, [{command: `odo push ${context.getName()} --app ${app.getName()} --project ${project.getName()}`, increment: 100}
99-
], Component.odo)
100-
.then(() => `Successfully pushed changes for '${context.getName()}'`);
93+
Component.odo.executeInTerminal(`odo push ${context.getName()} --app ${app.getName()} --project ${project.getName()}`);
10194
}
10295

10396
static watch(context: OpenShiftObject): void {

test/openshift/component.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,9 @@ suite('Openshift/Component', () => {
243243
});
244244

245245
test('push calls the correct odo command with progress', async () => {
246-
const progressStub = sandbox.stub(Progress, 'execWithProgress').resolves();
247246
const status = await Component.push(componentItem);
248-
const steps = [{
249-
command: `odo push ${componentItem.getName()} --app ${appItem.getName()} --project ${projectItem.getName()}`,
250-
increment: 100
251-
}];
252247

253-
expect(status).equals(`Successfully pushed changes for '${componentItem.getName()}'`);
254-
expect(progressStub).calledOnceWith(sinon.match.object, steps);
248+
expect(termStub).calledOnceWith(`odo push ${componentItem.getName()} --app ${appItem.getName()} --project ${projectItem.getName()}`);
255249
});
256250

257251
test('watch calls the correct odo command in terminal', () => {

0 commit comments

Comments
 (0)