Skip to content

Commit 74e858e

Browse files
author
Charlike Mike Reagent
committed
fix: cli simplify
1 parent 8ea2adb commit 74e858e

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
},
1919
"dependencies": {
2020
"@tunnckocore/execa": "^2.1.2",
21-
"@tunnckocore/package-json": "^1.0.1",
2221
"dedent": "^0.7.0",
2322
"detect-next-version": "^3.1.0",
2423
"esm": "^3.0.84",

src/cli.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,22 @@ import fs from 'fs';
22
import util from 'util';
33
import path from 'path';
44
import proc from 'process';
5-
import getPkg from '@tunnckocore/package-json';
65
import { exec } from '@tunnckocore/execa';
76
import isCI from 'is-ci';
87
import ded from 'dedent';
98

109
import release from './index';
1110

1211
export default function releaseCli(pkg, argv) {
13-
return getPkg(pkg.name)
14-
.then(({ version }) => (version !== pkg.version ? version : false))
15-
.catch((err) => {
16-
console.debug(`Error getting package metadata from the registry: ${err}`);
17-
console.debug("Don't worry, that is a check for latest cli version.");
18-
})
19-
.then((latestVersion) => {
20-
if (latestVersion) {
21-
console.log(`UPDATE AVAILABLE: v${latestVersion}`);
22-
console.log(
23-
'See:',
24-
`https://github.com/${pkg.repository}/releases/tag/v${latestVersion}`,
25-
);
26-
console.log('');
27-
}
12+
return release(argv)
13+
.then(async (result) => {
2814
if (argv.ci && !isCI) {
2915
console.error('Publishing is only allowed on CI services!');
3016
console.error(
3117
'Try passing --no-ci flag to bypass this, if you are sure.',
3218
);
3319
proc.exit(1);
3420
}
35-
})
36-
.then(() => release(argv))
37-
.then(async (result) => {
3821
if (argv.dry) {
3922
console.log(JSON.stringify(result, null, 2));
4023
console.log(argv);

0 commit comments

Comments
 (0)