@codigodoleo/wp-kit 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/init.js +5 -1
- package/package.json +1 -1
package/lib/commands/init.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
3
4
|
import fs from 'fs-extra';
|
|
4
5
|
import { runPrompts } from '../prompts/index.js';
|
|
5
6
|
import { Generator } from '../core/generator.js';
|
|
6
7
|
import { log, color } from '../utils/logger.js';
|
|
7
8
|
import { inferCiCapabilities } from '../core/infer-ci-capabilities.js';
|
|
8
9
|
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
|
|
9
13
|
export const initCommand = new Command('init')
|
|
10
14
|
.option('-o, --output <dir>', 'Output directory', '__test-sandbox__/test-project')
|
|
11
15
|
.option('--defaults', 'Use default answers without prompting')
|
|
@@ -114,7 +118,7 @@ export const initCommand = new Command('init')
|
|
|
114
118
|
});
|
|
115
119
|
|
|
116
120
|
for (const mod of enabledModules) {
|
|
117
|
-
const modIndexPath = path.resolve('modules', mod, 'index.js');
|
|
121
|
+
const modIndexPath = path.resolve(__dirname, '../../modules', mod, 'index.js');
|
|
118
122
|
if (await fs.pathExists(modIndexPath)) {
|
|
119
123
|
const { setupModule } = await import(modIndexPath);
|
|
120
124
|
if (typeof setupModule === 'function') {
|