/* * Put this in a place where node can find it (referenced by $SCRIPT_HOME in the driver script) * or figure out how to do this with JQ :) * * Basically, for every key that starts with "registry.terraform.io/hashicorp/" duplicate its value to * that same key with "hashicorp" translated to "-" (keep the original property too) */ const fs = require("fs") const output ={}; Object.entries(JSON.parse(fs.readFileSync( "/dev/stdin" ))).forEach(([key,value]) => { output[key] = value; if (key.startsWith("registry.terraform.io/hashicorp/")) { output[key.replace("hashicorp","-")] = value; } }); console.log(JSON.stringify(output))