Skip to content

Commit

Permalink
Fix plugin path (#58649) (#58703)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Liza Katz and elasticmachine authored Feb 27, 2020
1 parent 6cd0e5c commit 0045068
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/kbn-plugin-generator/sao_template/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 }) {
Expand Down

0 comments on commit 0045068

Please sign in to comment.