Skip to content

Commit

Permalink
Merge pull request #29 from twilio-infra-as-code/envFile-seach-fix
Browse files Browse the repository at this point in the history
fix(main): wrong commands were triggering envFile search
  • Loading branch information
kaiquelupo authored Jun 23, 2021
2 parents 3732bd8 + 89f59a1 commit 65de6f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ function getEnvironmentVariables(twilioClient, shouldGetEnvFromFile) {
function runPulumiCommand(args, interactive = true, twilioClient) {
try {

const isDifferentFromGetPulumiStack =
(args[0] !== "stack" && args[1] !== "ls");
const shouldGetEnvFromFile =
!(args[0] === "stack" && args[1] === "ls") &&
(args[0] !== "new");

if (interactive) {
Printer.printHeader('Pulumi CLI output');
childProcess.execFileSync('pulumi', args, {
stdio: 'inherit',
env: getEnvironmentVariables(twilioClient, isDifferentFromGetPulumiStack),
env: getEnvironmentVariables(twilioClient, shouldGetEnvFromFile),
});
Printer.printHeader('End of Pulumi CLI output');
} else {
const stdout = childProcess.execSync(`pulumi ${args.join(' ')}`, {
env: getEnvironmentVariables(twilioClient, isDifferentFromGetPulumiStack),
env: getEnvironmentVariables(twilioClient, shouldGetEnvFromFile),
});
return stdout.toString();
}
Expand Down

0 comments on commit 65de6f8

Please sign in to comment.