Skip to content

Commit

Permalink
invalid tf usage (#1293)
Browse files Browse the repository at this point in the history
* invalid tf usage

* additional -chdir ref

* debug

* debug

* debug

* Apply suggestions from code review

Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com>

* other quote entry

* rm debugging

Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com>
  • Loading branch information
dacbd and 0x2b3bfa0 authored Dec 20, 2022
1 parent f209abd commit 644dfe0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/terraform.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const saveTfState = async (opts = {}) => {

const init = async (opts = {}) => {
const { dir = './' } = opts;
return await exec('terraform', '-chdir', dir, 'init');
return await exec('terraform', `-chdir=${dir}`, 'init');
};

const apply = async (opts = {}) => {
Expand All @@ -43,7 +43,7 @@ const apply = async (opts = {}) => {
try {
await tfCapture(
'terraform',
[`-chdir='${dir}'`, 'apply', '-auto-approve', '-json'],
[`-chdir=${dir}`, 'apply', '-auto-approve', '-json'],
{
cwd: process.cwd(),
env,
Expand All @@ -60,8 +60,7 @@ const destroy = async (opts = {}) => {
const { dir = './', target } = opts;
return await exec(
'terraform',
'-chdir',
dir,
`-chdir=${dir}`,
'destroy',
'-auto-approve',
...(target ? ['-target', target] : [])
Expand Down

0 comments on commit 644dfe0

Please sign in to comment.