cptmpl
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -24,3 +24,5 @@ 'use strict' | ||
const content = await fs.readFile(src, { encoding: 'utf8' }) | ||
const rendered = ejs.render(content, data) | ||
const rendered = ejs.render(content, data, { | ||
filename: src | ||
}) | ||
@@ -27,0 +29,0 @@ // If we are not forcing, check for conflicts |
{ | ||
"name": "cptmpl", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Copy and process a template file", | ||
@@ -5,0 +5,0 @@ "author": "Wes Todd <wes@wesleytodd.com>", |
@@ -76,2 +76,10 @@ 'use strict' | ||
}) | ||
it('should support ejs includes', async function () { | ||
await cptmpl(path.join(FIX_DIR, 'include.md'), path.join(TMP_DIR, 'include.md'), { | ||
name: 'include' | ||
}) | ||
assert(await fs.pathExists(path.join(TMP_DIR, 'include.md'))) | ||
assert(await fs.readFileSync(path.join(TMP_DIR, 'include.md')).includes('Hello include!')) | ||
}) | ||
}) |
12738
12
190