mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-12 18:49:41 -04:00
committed by
Zoltan Kochan
parent
9e2a5b827e
commit
4063f1bee7
5
.changeset/blue-wombats-help.md
Normal file
5
.changeset/blue-wombats-help.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-publishing": major
|
||||
---
|
||||
|
||||
Git checks are on by default.
|
||||
@@ -52,8 +52,8 @@ export function help () {
|
||||
|
||||
list: [
|
||||
{
|
||||
description: 'Checks if current branch is your publish branch, clean, and up-to-date',
|
||||
name: '--git-checks',
|
||||
description: "Don't check if current branch is your publish branch, clean, and up-to-date",
|
||||
name: '--no-git-checks',
|
||||
},
|
||||
{
|
||||
description: 'Sets branch name to publish. Default is master',
|
||||
@@ -94,7 +94,7 @@ export async function handler (
|
||||
} & Pick<Config, 'allProjects' | 'gitChecks' | 'ignoreScripts' | 'publishBranch'>,
|
||||
params: string[],
|
||||
) {
|
||||
if (opts.gitChecks && await isGitRepo()) {
|
||||
if (opts.gitChecks !== false && await isGitRepo()) {
|
||||
const branch = opts.publishBranch ?? 'master'
|
||||
if (await getCurrentBranch() !== branch) {
|
||||
const { confirm } = await prompt({
|
||||
|
||||
@@ -41,7 +41,6 @@ test('publish: fails git check if branch is not on master', async (t) => {
|
||||
...DEFAULT_OPTS,
|
||||
argv: { original: ['publish', ...CREDENTIALS] },
|
||||
dir: process.cwd(),
|
||||
gitChecks: true,
|
||||
}, [])
|
||||
} catch (_err) {
|
||||
err = _err
|
||||
@@ -72,7 +71,6 @@ test('publish: fails git check if branch is not on specified branch', async (t)
|
||||
...DEFAULT_OPTS,
|
||||
argv: { original: ['publish', ...CREDENTIALS] },
|
||||
dir: process.cwd(),
|
||||
gitChecks: true,
|
||||
publishBranch: 'latest',
|
||||
}, [])
|
||||
} catch (_err) {
|
||||
@@ -103,7 +101,6 @@ test('publish: fails git check if branch is not clean', async (t) => {
|
||||
...DEFAULT_OPTS,
|
||||
argv: { original: ['publish', ...CREDENTIALS] },
|
||||
dir: process.cwd(),
|
||||
gitChecks: true,
|
||||
}, [])
|
||||
} catch (_err) {
|
||||
err = _err
|
||||
@@ -138,7 +135,6 @@ test('publish: fails git check if branch is not up-to-date', async (t) => {
|
||||
...DEFAULT_OPTS,
|
||||
argv: { original: ['publish', ...CREDENTIALS] },
|
||||
dir: process.cwd(),
|
||||
gitChecks: true,
|
||||
}, [])
|
||||
} catch (_err) {
|
||||
err = _err
|
||||
|
||||
Reference in New Issue
Block a user