@vitarx/release-cli 1.0.2 → 1.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/dist/release.js +4 -3
- package/package.json +1 -1
package/dist/release.js
CHANGED
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import process from 'node:process';
|
|
6
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
6
7
|
import { checkGitStatus, detectPackageManager, formatVersionNumber, getWorkspacePackages, isWorkspaceProject, log, prompt, rollbackChanges, runCommand, selectVersion, updateVersion } from './utils.js';
|
|
7
8
|
/**
|
|
8
9
|
* 解析命令行参数
|
|
@@ -219,13 +220,13 @@ async function publishPackage(pkgDir, packageManager, isDryRun = false, args) {
|
|
|
219
220
|
*/
|
|
220
221
|
export async function main() {
|
|
221
222
|
const args = parseArgs();
|
|
223
|
+
console.log(chalk.cyan('📦 Release CLI - NPM包发布工具'));
|
|
222
224
|
// 显示版本信息
|
|
223
225
|
if (args.showVersion) {
|
|
224
|
-
const { version } = JSON.parse(fs.readFileSync(
|
|
225
|
-
log
|
|
226
|
+
const { version } = JSON.parse(fs.readFileSync(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf-8'));
|
|
227
|
+
console.log(version);
|
|
226
228
|
process.exit(0);
|
|
227
229
|
}
|
|
228
|
-
console.log(chalk.cyan('📦 Release CLI - NPM包发布工具'));
|
|
229
230
|
if (args.showHelp) {
|
|
230
231
|
console.log('');
|
|
231
232
|
console.log(chalk.yellow('使用方法:'));
|