Skip to content

Commit 221baba

Browse files
RobinKnipecrutchcorn
authored andcommitted
Honour load method contract
Currently the `load` function doesn't include all assets when the `includeCfg` option is set to `true`, *it doesn't load anything*! The suggested code change should bring the implementation back into line with the docs: https://github.com/plopjs/plop/blob/master/plop-load.md#interface-includedefinition
1 parent ec2ebe1 commit 221baba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,25 @@ async function nodePlop(plopfilePath = "", plopCfg = {}) {
125125
const genNameList = proxy.getGeneratorList().map((g) => g.name);
126126
loadAsset(
127127
genNameList,
128-
include.generators,
128+
includeCfg === true || include.generators,
129129
setGenerator,
130130
(proxyName) => ({ proxyName, proxy })
131131
);
132132
loadAsset(
133133
proxy.getPartialList(),
134-
include.partials,
134+
includeCfg === true || include.partials,
135135
setPartial,
136136
proxy.getPartial
137137
);
138138
loadAsset(
139139
proxy.getHelperList(),
140-
include.helpers,
140+
includeCfg === true || include.helpers,
141141
setHelper,
142142
proxy.getHelper
143143
);
144144
loadAsset(
145145
proxy.getActionTypeList(),
146-
include.actionTypes,
146+
includeCfg === true || include.actionTypes,
147147
setActionType,
148148
proxy.getActionType
149149
);

0 commit comments

Comments
 (0)