Skip to content

Commit

Permalink
Update with attempt at fixing array parsing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerAldrich committed Oct 26, 2023
1 parent 902ac1d commit 6f68a3f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pulumi/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ export class PulumiPlugin extends BasePlugin {
var_value = value.replace('file:', '');
}

if (typeof value === 'object') {
const dotObj = dot(value);
for (const [nestedKey, nestedValue] of Object.entries(dotObj)) {

apply_vars.push(`--path --plaintext '${key}:${nestedKey.replaceAll('.', ':')}'='${nestedValue}'`);
if (typeof var_value === 'object') {
// TODO: Something isn't quite correct still when we have something like a command array
if (Array.isArray(value)) {
apply_vars.push(`--path --plaintext '${key}':'${JSON.stringify(var_value)}'`);
} else {
const dotObj = dot(value);
for (const [nestedKey, nestedValue] of Object.entries(dotObj)) {
apply_vars.push(`--path --plaintext '${key}:${nestedKey.replaceAll('.', ':')}'='${nestedValue}'`);
}
}
} else {
apply_vars.push(`--path --plaintext '${key}'='${var_value}'`);
Expand Down

0 comments on commit 6f68a3f

Please sign in to comment.