Skip to content

Commit b106460

Browse files
committed
templateFile changes aren't needed if file exists
1 parent 37c875b commit b106460

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/node-plop/src/actions/append.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
import actionInterfaceTest from "./_common-action-interface-check.js";
1212

1313
const doAppend = async function (data, cfg, plop, fileData) {
14-
cfg.templateFile = getRenderedTemplatePath(data, cfg, plop);
1514
const stringToAppend = await getRenderedTemplate(data, cfg, plop);
1615
// if the appended string should be unique (default),
1716
// remove any occurence of it (but only if pattern would match)
@@ -54,6 +53,7 @@ export default async function (data, cfg, plop) {
5453
throw "File does not exist";
5554
} else {
5655
let fileData = await fspp.readFile(fileDestPath);
56+
cfg.templateFile = getRenderedTemplatePath(data, cfg, plop);
5757
fileData = await doAppend(data, cfg, plop, fileData);
5858
await fspp.writeFile(fileDestPath, fileData);
5959
}

0 commit comments

Comments
 (0)