Skip to content

Commit

Permalink
fix(cli-plugin-deploy-pulumi): skip caching stack output if no values…
Browse files Browse the repository at this point in the history
… inside
  • Loading branch information
brunozoric committed Feb 7, 2025
1 parent 372b38b commit 0d5359d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ const getOutputJson = ({
cwd: cwd || project.root
});

return (cache[cacheKey] = JSON.parse(stdout));
const parsed = JSON.parse(stdout);
if (Object.keys(parsed).length === 0) {
return null;
}
cache[cacheKey] = parsed;
return parsed;
} catch (e) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ const getOutputJson = ({ folder, env, cwd, variant }: IGetOutputJsonParams) => {

// Let's get the output after the first line break. Everything before is just yarn stuff.
const extractedJSON = stdout.substring(stdout.indexOf("{"));
return (cache[cacheKey] = JSON.parse(extractedJSON));
const parsed = JSON.parse(extractedJSON);
if (Object.keys(parsed).length === 0) {
return null;
}
cache[cacheKey] = parsed;
return parsed;
} catch (e) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"packages/cli-plugin-deploy-pulumi/src/utils/workspaceTemplate/**",
"packages/cli",
"packages/create-webiny-project",
"packages/cwp-template-aws",
"packages/cwp-template-aws/**",
"packages/project-utils",
"packages/tracking"
]
Expand Down

0 comments on commit 0d5359d

Please sign in to comment.