Fix plugin path (#58649) (#58703)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Liza Katz 2020-02-27 13:07:38 +00:00 committed by GitHub
parent 6cd0e5c0d6
commit 0045068313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,8 +135,11 @@ module.exports = function({ name, targetPath }) {
'eslintrc.js': '.eslintrc.js',
'i18nrc.json': '.i18nrc.json',
},
data: answers =>
Object.assign(
data: answers => {
const pathToPlugin = answers.customPath
? resolve(answers.customPath, camelCase(name), 'public')
: resolve(targetPath, 'public');
return Object.assign(
{
templateVersion: pkg.version,
startCase,
@ -150,13 +153,11 @@ module.exports = function({ name, targetPath }) {
hasUi: !!answers.generateApp,
hasServer: !!answers.generateApi,
hasScss: !!answers.generateScss,
relRoot: relative(
resolve(answers.customPath || targetPath, name, 'public'),
process.cwd()
),
relRoot: relative(pathToPlugin, process.cwd()),
},
answers
),
);
},
enforceNewFolder: true,
installDependencies: false,
async post({ log, answers }) {