@jahed/terraform
Version:
A wrapper which downloads and runs Terraform locally via npm.
19 lines (18 loc) • 666 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const getOutputs_1 = require("./getOutputs");
const install_1 = require("./install");
const cli = async () => {
const args = process.argv.slice(2);
const outputs = (0, getOutputs_1.getOutputs)();
await (0, install_1.install)(outputs);
const terraform = (0, child_process_1.spawn)(outputs.path, args, {
stdio: [process.stdin, process.stdout, process.stderr],
});
terraform.on("close", (code) => process.exit(code || undefined));
};
cli().catch((error) => {
console.error(error);
process.exit(1);
});