(template, liquidData)
| 12 | import { exec } from 'child_process'; |
| 13 | |
| 14 | async function expandLiquidTemplates(template, liquidData) { |
| 15 | const entries = await glob([path.join(template, "**/*.liquid")], { |
| 16 | dot: true, |
| 17 | ignore: ["**/node_modules"], |
| 18 | }); |
| 19 | |
| 20 | for (const entry of entries) { |
| 21 | const engine = new Liquid(); |
| 22 | const rendered = await engine.renderFile(entry, liquidData); |
| 23 | const outputPath = entry.replace(".liquid", ""); |
| 24 | await fs.writeFile(outputPath, rendered); |
| 25 | console.log(` ${path.relative(process.cwd(), outputPath)}`); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | async function expandAppLiquidTemplates(appDir) { |
| 30 | const samplePath = path.join(process.cwd(), appDir); |
no outgoing calls
no test coverage detected