diff --git a/scripts/fetch-icons/generators/generateAndroidIcons.ts b/scripts/fetch-icons/generators/generateAndroidIcons.ts index 3f69e421..abb5e2b1 100644 --- a/scripts/fetch-icons/generators/generateAndroidIcons.ts +++ b/scripts/fetch-icons/generators/generateAndroidIcons.ts @@ -10,6 +10,7 @@ import { createFolder, toSnakeCase } from "../../utils/fileUtils.js"; */ export const generateAndroidIcons = (outputDir: string, iconManifest: IconManifest) => { createFolder(outputDir); + copyReadme(outputDir); for (const icon of iconManifest) { const definition = icon[1]; const svg = readFileSync(definition.roundPath).toString(); @@ -55,3 +56,13 @@ export const extractPath = (svgData: string): string => { } return path; }; + +/** + * Copies the README file to the output directory. + * This is useful for users to understand how to use the generated icons, but is also useful for the CI/CD pipeline so that for every version release there will be a change. + * @param outputDir - The android output directory. + */ +const copyReadme = (outputDir: string) => { + const readme = readFileSync("./scripts/fetch-icons/templates/android-readme.md.template").toString(); + writeFileSync(`${outputDir}/README.md`, readme); +}; diff --git a/scripts/fetch-icons/templates/android-readme.md.template b/scripts/fetch-icons/templates/android-readme.md.template new file mode 100644 index 00000000..e10026eb --- /dev/null +++ b/scripts/fetch-icons/templates/android-readme.md.template @@ -0,0 +1,7 @@ + + +# Zeta Icons v0.8.1 + + + +The icons in this directory are part of the Zeta Icons library. To see a full list of icons, visit [Zeta Icons](https://design.zebra.com/icons)