Skip to content

Commit

Permalink
fix: update qt out filename (#95)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
  • Loading branch information
grant authored Nov 2, 2020
1 parent bb16887 commit ecea56c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/quicktype-wrapper/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ if (!module.parent) {
console.log();

// Loop through every path
console.log(`Generating ${L} files:`);
const pathPromises = absPaths.map(async (f: string, i: number) => {
const file = readFileSync(f) + '';
const pathToSchema = relPaths[i]; // e.g. /google/events/cloud/pubsub/MessagePublishedData.json
Expand All @@ -137,9 +138,7 @@ if (!module.parent) {

// For each type file...
// Keep a stdout buffer per type to not intertwine output
const bufferedOutput: string[] = [
`## Generating files for ${typeName}...`,
];
const bufferedOutput: string[] = [];
for (const [filename, genFileContents] of Object.entries(genFiles)) {
let fileContentsMaybeWithLicenseHeader = genFileContents;
// Optionally add license headers
Expand All @@ -156,7 +155,7 @@ if (!module.parent) {
// This next if statement handles if Quicktype generated one or many files
if (filename === 'stdout') {
// For languages that just produce one file, Quicktype output filename is 'stdout'.
const relativeFilePath = `${relativePathTargetDirectory}/${filename}`;
const relativeFilePath = relativePathTargetDirectory;
const absFilePathDir = `${OUT}/${relativePathTargetDirectory}`;

// Create dir
Expand Down

0 comments on commit ecea56c

Please sign in to comment.