From c0a9fb8aa23303660e202610de256f7a7ce4c22c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 22 Oct 2024 10:03:09 +0100 Subject: [PATCH] docs: Add android readme --- .../fetch-icons/generators/generateAndroidIcons.ts | 11 +++++++++++ .../fetch-icons/templates/android-readme.md.template | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 scripts/fetch-icons/templates/android-readme.md.template 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)