/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/commands/version/src/lib/git-push.ts
34 строки
1 KB
James Henry
chore(repo): migrate from jest to vitest (#4389)
13 июл 2026, 20:06
Не верифицирован
13 июл 2026, 20:06
1f7e109
Код
Авторство
О чём код?
import { log } from "@lerna/core"; import { ExecOptions } from "child_process"; import * as childProcess from "@lerna/child-process"; export function gitPush(remote: string, branch: string, opts: ExecOptions) { log.silly("gitPush", remote, branch); return childProcess .exec("git", ["push", "--follow-tags", "--no-verify", "--atomic", remote, branch], opts as any) .catch((error) => { // @see https://github.com/sindresorhus/execa/blob/v1.0.0/index.js#L159-L179 // the error message _should_ be on stderr except when GIT_REDIRECT_STDERR has been configured to redirect // to stdout. More details in https://git-scm.com/docs/git#Documentation/git.txt-codeGITREDIRECTSTDERRcode if ( /atomic/.test(error.stderr) || (process.env["GIT_REDIRECT_STDERR"] === "2>&1" && /atomic/.test(error.stdout)) ) { // --atomic is only supported in git >=2.4.0, which some crusty CI environments deem unnecessary to upgrade. // so let's try again without attempting to pass an option that is almost 5 years old as of this writing... log.warn("gitPush", error.stderr); log.info("gitPush", "--atomic failed, attempting non-atomic push"); return childProcess.exec( "git", ["push", "--follow-tags", "--no-verify", remote, branch], opts as any ); } // ensure unexpected errors still break chain throw error; }); }