-
Notifications
You must be signed in to change notification settings - Fork 859
[EuiIcon] Add generated file comment #5210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ function pascalCase(x) { | |
|
|
||
| const iconFiles = glob.sync('**/*.svg', { cwd: iconsDir, realpath: true }); | ||
|
|
||
| iconFiles.forEach(async filePath => { | ||
| iconFiles.forEach(async (filePath) => { | ||
| const svgSource = fs.readFileSync(filePath); | ||
|
|
||
| try { | ||
|
|
@@ -55,7 +55,8 @@ export const icon = ${componentName}; | |
| ); | ||
|
|
||
| const outputFilePath = filePath.replace(/\.svg$/, '.js'); | ||
| fs.writeFileSync(outputFilePath, jsxSource); | ||
| const comment = '// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY\n\n'; | ||
| fs.writeFileSync(outputFilePath, comment + jsxSource); | ||
|
Comment on lines
+58
to
+59
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments in ast are a bit of a headache apparently (you have to pass in a custom |
||
| } catch (e) { | ||
| console.error(`Error processing ${filePath}`); | ||
| console.error(e); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a Prettier autofix on save