Skip to content

Commit

Permalink
Merge pull request #481 from weaveworks/apply-editor-path
Browse files Browse the repository at this point in the history
(Prerelease) kubectl apply open editor file path
  • Loading branch information
Kingdon Barrett authored Sep 12, 2023
2 parents c138be0 + a693ec0 commit a052395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/kubectlApply.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as shell from 'cli/shell/exec';
import { Uri } from 'vscode';
import { Uri, window } from 'vscode';

export async function kubectlApplyPath(uri?: Uri) {
uri ??= window.activeTextEditor?.document.uri;
if(uri) {
return await shell.execWithOutput(`kubectl apply -f ${uri.fsPath}`);
}
}
export async function kubectlDeletePath(uri?: Uri) {
uri ??= window.activeTextEditor?.document.uri;
if(uri) {
return await shell.execWithOutput(`kubectl delete -f ${uri.fsPath}`);
}
Expand Down

0 comments on commit a052395

Please sign in to comment.