diff --git a/src/cli_plugin/install/install.js b/src/cli_plugin/install/install.js index e76755c3b7ff..e48c7a1c1349 100644 --- a/src/cli_plugin/install/install.js +++ b/src/cli_plugin/install/install.js @@ -41,6 +41,7 @@ import { cleanPrevious, cleanArtifacts } from './cleanup'; import { extract, getPackData } from './pack'; import { renamePlugin } from './rename'; import { existingInstall, assertVersion } from './opensearch_dashboards'; +import { kebabCase } from 'lodash'; const mkdir = promisify(Fs.mkdir); @@ -62,7 +63,7 @@ export async function install(settings, logger) { assertVersion(settings); - const targetDir = path.join(settings.pluginDir, settings.plugins[0].id); + const targetDir = path.join(settings.pluginDir, kebabCase(settings.plugins[0].id)); await renamePlugin(settings.workingPath, targetDir); logger.log('Plugin installation complete'); diff --git a/src/cli_plugin/install/opensearch_dashboards.js b/src/cli_plugin/install/opensearch_dashboards.js index 5f31372f40d0..1aaf6a5cdf56 100644 --- a/src/cli_plugin/install/opensearch_dashboards.js +++ b/src/cli_plugin/install/opensearch_dashboards.js @@ -32,12 +32,13 @@ import path from 'path'; import { statSync } from 'fs'; +import { kebabCase } from 'lodash'; import { versionSatisfies, cleanVersion } from '../../legacy/utils/version'; export function existingInstall(settings, logger) { try { - statSync(path.join(settings.pluginDir, settings.plugins[0].id)); + statSync(path.join(settings.pluginDir, kebabCase(settings.plugins[0].id))); logger.error( `Plugin ${settings.plugins[0].id} already exists, please remove before installing a new version`