@itbox/cli 0.0.2 → 0.0.3
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/bin/index.js +4 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -6,8 +6,11 @@ import path from 'path';
|
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import { execSync } from 'child_process';
|
|
8
8
|
import os from 'os';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
9
10
|
|
|
10
11
|
const { prompt } = inquirer;
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
11
14
|
|
|
12
15
|
// 配置文件相关
|
|
13
16
|
const CONFIG_DIR = path.join(os.homedir(), '.fe-cli');
|
|
@@ -117,7 +120,7 @@ function checkTemplateRepoConfig() {
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
// 从package.json获取项目信息
|
|
120
|
-
const packagePath = path.resolve(
|
|
123
|
+
const packagePath = path.resolve(__dirname, '../package.json');
|
|
121
124
|
const packageInfo = fs.readJSONSync(packagePath);
|
|
122
125
|
|
|
123
126
|
// 命令行配置
|