From 45df886890f2039d88f9675d401f2c7c85ce781e Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Thu, 1 Jul 2021 14:39:55 -0700 Subject: [PATCH] Revert "Default to converting folder name for cli plugin to kebab-case (#357)" (#578) This reverts commit 747ef8eb6fc15b62c26a9af832561254b3522c42. Reverting for now because the full impact is not known and requires subsequent commits to mitigate confusion related to CLI output. Also, it seems like in the code there exists verification on the code that plugins should explicitly be camelCase. So this merits more discussion. Issues related: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/322 https://github.com/opensearch-project/OpenSearch-Dashboards/issues/465 https://github.com/opensearch-project/OpenSearch-Dashboards/issues/366 Signed-off-by: Kawika Avilla --- src/cli_plugin/install/install.js | 3 +-- src/cli_plugin/install/opensearch_dashboards.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cli_plugin/install/install.js b/src/cli_plugin/install/install.js index e48c7a1c1349..e76755c3b7ff 100644 --- a/src/cli_plugin/install/install.js +++ b/src/cli_plugin/install/install.js @@ -41,7 +41,6 @@ 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); @@ -63,7 +62,7 @@ export async function install(settings, logger) { assertVersion(settings); - const targetDir = path.join(settings.pluginDir, kebabCase(settings.plugins[0].id)); + const targetDir = path.join(settings.pluginDir, 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 1aaf6a5cdf56..5f31372f40d0 100644 --- a/src/cli_plugin/install/opensearch_dashboards.js +++ b/src/cli_plugin/install/opensearch_dashboards.js @@ -32,13 +32,12 @@ 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, kebabCase(settings.plugins[0].id))); + statSync(path.join(settings.pluginDir, settings.plugins[0].id)); logger.error( `Plugin ${settings.plugins[0].id} already exists, please remove before installing a new version`