Skip to content

Commit

Permalink
Revert "Revert "Default to converting folder name for cli plugin to k…
Browse files Browse the repository at this point in the history
…ebab-case (opensearch-project#357)" (opensearch-project#578)"

This reverts commit 45df886.
  • Loading branch information
kavilla committed Jul 28, 2021
1 parent e291185 commit 5469a87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli_plugin/install/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/install/opensearch_dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 5469a87

Please sign in to comment.