Skip to content

Commit

Permalink
feat: add notice to top of generated files (#56)
Browse files Browse the repository at this point in the history
Resolves #55
  • Loading branch information
dpilch authored Sep 10, 2021
1 parent 5b26c07 commit 4f492cd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/studio-ui-codegen-react/lib/react-output-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ export class ReactOutputManager extends FrameworkOutputManager<string> {
throw new Error('You must call renderComponent before you can save the file.');
}

await fs.writeFile(outputPath, '/* eslint-disable */');
await fs.writeFile(outputPath, input);
const generatedNotice = `\
/***************************************************************************
* The contents of this file were generated with Amplify Studio. *
* Please refrain from making any modifications to this file. *
* Any changes to this file will be overwritten when running amplify pull. *
**************************************************************************/
`;
const generatedOutput = `${generatedNotice}${input}`;

await fs.writeFile(outputPath, generatedOutput);
}
}

0 comments on commit 4f492cd

Please sign in to comment.