Skip to content

Commit c33686a

Browse files
committed
feat: support config npmClient
1 parent fa1c031 commit c33686a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

command.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ const yargs = require('yargs')
121121
type: 'string',
122122
describe: 'Name of the package from which the tags will be extracted'
123123
})
124+
.option('npmClient', {
125+
type: 'string',
126+
default: defaults.npmClient,
127+
describe: 'Show publish hint with the specified npm client'
128+
})
124129
.check((argv) => {
125130
if (typeof argv.scripts !== 'object' || Array.isArray(argv.scripts)) {
126131
throw Error('scripts must be an object')

defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const defaults = {
1414
dryRun: false,
1515
tagForce: false,
1616
gitTagFallback: true,
17-
preset: require.resolve('conventional-changelog-conventionalcommits')
17+
preset: require.resolve('conventional-changelog-conventionalcommits'),
18+
npmClient: 'npm',
1819
}
1920

2021
/**

lib/lifecycles/tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function execTag (newVersion, pkgPrivate, args) {
2828
const currentBranch = await runExecFile('', 'git', ['rev-parse', '--abbrev-ref', 'HEAD'])
2929
let message = 'git push --follow-tags origin ' + currentBranch.trim()
3030
if (pkgPrivate !== true && bump.getUpdatedConfigs()['package.json']) {
31-
message += ' && npm publish'
31+
message += ` && ${args.npmClient || 'npm'} publish`
3232
if (args.prerelease !== undefined) {
3333
if (args.prerelease === '') {
3434
message += ' --tag prerelease'

0 commit comments

Comments
 (0)