diff --git a/frontend/src/assets/icons/helpers/convertSvgToVue.js b/frontend/src/assets/icons/helpers/convertSvgToVue.js new file mode 100644 index 000000000..d92ba2f7d --- /dev/null +++ b/frontend/src/assets/icons/helpers/convertSvgToVue.js @@ -0,0 +1,24 @@ +// usage: +// put source files in folder 'svgs' +// folder 'svgComponents' have to exist +// call script with command 'node convertSvgToVue.js' +// delete source files or whole folder +// run 'lint --fix' afterwards + +import { readdirSync, readFileSync, writeFileSync } from 'fs' +import { join, parse } from 'path' + +const inputDir = '../svgs' +const outputDir = '../svgComponents' + +readdirSync(inputDir).forEach((file) => { + const filePath = join(inputDir, file) + const fileName = parse(file).name + // eslint-disable-next-line security/detect-non-literal-fs-filename + const content = readFileSync(filePath, 'utf8') + const vueComponent = `\n\n\n\n\n` + + const outputFilePath = join(outputDir, `${fileName}.vue`) + // eslint-disable-next-line security/detect-non-literal-fs-filename + writeFileSync(outputFilePath, vueComponent) +})