fix(terraform): check line validity (#12102)

This commit is contained in:
Rhys Arkins 2021-10-10 21:05:08 +02:00 committed by GitHub
parent f74404b3c2
commit da1b7d54a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,7 @@ export function extractTerraformProvider(
}
const line = lines[lineNumber];
if (line) {
// `{` will be counted wit +1 and `}` with -1. Therefore if we reach braceCounter == 0. We have found the end of the terraform block
const openBrackets = (line.match(/\{/g) || []).length;
const closedBrackets = (line.match(/\}/g) || []).length;
@ -53,7 +54,7 @@ export function extractTerraformProvider(
}
}
}
}
lineNumber += 1;
} while (braceCounter !== 0);
deps.push(dep);