diff --git a/bazel/api-golden/index_npm_packages.ts b/bazel/api-golden/index_npm_packages.ts index 405dee955..10b8de378 100644 --- a/bazel/api-golden/index_npm_packages.ts +++ b/bazel/api-golden/index_npm_packages.ts @@ -70,6 +70,7 @@ async function main( // Keep track of outdated goldens. if (actual !== expected) { if (approveGolden) { + fs.mkdirSync(path.dirname(goldenFilePath), {recursive: true}); fs.writeFileSync(goldenFilePath, actual, 'utf8'); } else { outdatedGoldens.push(goldenName);