Skip to content

Commit 29f0bb4

Browse files
committed
Make default config directory agnostic. Fix kepabCasing beaking installs
1 parent bc2a0d3 commit 29f0bb4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/cli/bin/install-plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ const installPlugin = (plugin, config) =>
1111
wrapAsync(function*() {
1212
const name = plugin.name || plugin;
1313
const safePluginName = _.kebabCase(name);
14-
yield checkAndInstallPackage(safePluginName);
14+
yield checkAndInstallPackage(name);
1515
// Put the installed plugin in the patternlab-config.json
1616
_.set(config, `plugins[${safePluginName}]['enabled']`, true);
1717

1818
// Get the options from the plugin, if any
1919
const pluginPathConfig = path.resolve(
20-
path.join(process.cwd(), 'node_modules', safePluginName, 'config.json')
20+
path.join(process.cwd(), 'node_modules', name, 'config.json')
2121
);
2222
try {
2323
const pluginConfigJSON = require(pluginPathConfig);

packages/cli/bin/patternlab.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22
'use strict';
33
const cli = require('commander');
4+
const path = require('path');
45
const build = require('./cli-actions/build');
56
const disable = require('./cli-actions/disable');
67
const enable = require('./cli-actions/enable');
@@ -42,7 +43,7 @@ cli
4243
'-c, --config <path>',
4344
'Specify config file. Default looks up the project dir',
4445
val => val.trim(),
45-
'./patternlab-config.json'
46+
path.resolve(process.cwd(), 'patternlab-config.json')
4647
)
4748
.option('-v, --verbose', 'Show verbose console logs', verboseLogs)
4849
.option('--silent', 'Turn off console logs', silenceLogs);

0 commit comments

Comments
 (0)