mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
rename the plugin before optimizing
When installing a plugin, if the plugin uses the file loader then the filename will be placed into a path within the ".plugin.installing" directory. This causes the build to contain invalid urls, so we need to rename the directory before optimizing Fixes #5668
This commit is contained in:
parent
378d956770
commit
a953e82e3f
2 changed files with 8 additions and 4 deletions
|
@ -28,7 +28,10 @@ module.exports = function (settings, logger) {
|
|||
// delete the working directory.
|
||||
// At this point we're bailing, so swallow any errors on delete.
|
||||
|
||||
try { rimraf.sync(settings.workingPath); }
|
||||
try {
|
||||
rimraf.sync(settings.workingPath);
|
||||
rimraf.sync(settings.pluginPath);
|
||||
}
|
||||
catch (e) {} // eslint-disable-line no-empty
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ function install(settings, logger) {
|
|||
.then(function () {
|
||||
return downloader.download();
|
||||
})
|
||||
.then(function () {
|
||||
fs.renameSync(settings.workingPath, settings.pluginPath);
|
||||
})
|
||||
.then(async function() {
|
||||
logger.log('Optimizing and caching browser bundles...');
|
||||
let serverConfig = _.merge(
|
||||
|
@ -49,8 +52,7 @@ function install(settings, logger) {
|
|||
},
|
||||
plugins: {
|
||||
initialize: false,
|
||||
scanDirs: [settings.pluginDir, fromRoot('src/plugins')],
|
||||
paths: [settings.workingPath]
|
||||
scanDirs: [settings.pluginDir, fromRoot('src/plugins')]
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -60,7 +62,6 @@ function install(settings, logger) {
|
|||
await kbnServer.close();
|
||||
})
|
||||
.then(function () {
|
||||
fs.renameSync(settings.workingPath, settings.pluginPath);
|
||||
logger.log('Plugin installation complete');
|
||||
})
|
||||
.catch(function (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue