fixing file paths when generating CT inside plugins

This commit is contained in:
sunnyson 2021-12-29 14:02:27 +02:00
parent d12900c0be
commit 2435689d50

View File

@ -65,6 +65,7 @@ module.exports = plop => {
};
},
actions(answers) {
const resolveFilePath = (isPlugin,filePath) => isPlugin ? `${filePath}/server` : filePath;
const attributes = answers.attributes.reduce((object, answer) => {
const val = { type: answer.attributeType };
@ -80,7 +81,7 @@ module.exports = plop => {
return Object.assign(object, { [answer.attributeName]: val }, {});
}, {});
const filePath = getFilePath(answers.destination);
const filePath = resolveFilePath(answers.plugin,getFilePath(answers.destination));
const baseActions = [
{