Skip to content

Commit

Permalink
update nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy committed May 9, 2024
1 parent e70168c commit 6821d9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/configure/ensureTemplateCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
manifest: NormalizedReadResult;
}

const recordSchema = z.record(z.string());
const recordSchema = z.object({ templateData: z.record(z.string()) });

const getTemplateDataFromStdIn = async (
templateConfig: TemplateConfig,
Expand All @@ -35,7 +35,7 @@ const getTemplateDataFromStdIn = async (
const data = recordSchema.parse(config);

templateConfig.fields.forEach((field) => {
const value = data[field.name];
const value = data.templateData[field.name];
if (value === undefined) {
throw new Error(`Missing field: ${field.name}`);
}
Expand All @@ -45,7 +45,7 @@ const getTemplateDataFromStdIn = async (
}
});

return data;
return data.templateData;
};

export const ensureTemplateCompletion = async ({
Expand Down

0 comments on commit 6821d9c

Please sign in to comment.