Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
Signed-off-by: yxxhero <[email protected]>
  • Loading branch information
yxxhero committed Dec 15, 2023
1 parent fbdf857 commit 8646ca8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
11 changes: 10 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions src/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ export async function installHelm(version: string): Promise<void> {
export async function installHelmPlugins(plugins: string[]): Promise<void> {
for (const plugin of plugins) {
try {
const result = await getExecOutput(`helm plugin install ${plugin.trim()}`, [], {
ignoreReturnCode: true
});
if (result.exitCode == 1 && result.stdout.includes('plugin already exists')) {
const result = await getExecOutput(
`helm plugin install ${plugin.trim()}`,
[],
{
ignoreReturnCode: true
}
);
if (
result.exitCode == 1 &&
result.stdout.includes('plugin already exists')
) {
core.info(`Plugin ${plugin} already exists`);
} else {
throw new Error(result.stderr);
Expand Down

0 comments on commit 8646ca8

Please sign in to comment.