UNPKG

lerna

Version:

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository

41 lines (38 loc) 975 B
import { exec, npmlog_default, temp_write_default } from "./chunk-WC2B4V4E.js"; // libs/commands/version/src/lib/git-commit.ts import { EOL } from "os"; function gitCommit(message, { amend, commitHooks, signGitCommit, signoffGitCommit, overrideMessage }, opts) { npmlog_default.silly("gitCommit", message); const args = ["commit"]; if (commitHooks === false) { args.push("--no-verify"); } if (signGitCommit) { args.push("--gpg-sign"); } if (signoffGitCommit) { args.push("--signoff"); } const shouldChangeMessage = amend ? amend && overrideMessage : true; if (amend) { args.push("--amend"); } if (shouldChangeMessage) { if (message.indexOf(EOL) > -1) { args.push("-F", temp_write_default.sync(message, "lerna-commit.txt")); } else { args.push("-m", message); } } else { args.push("--no-edit"); } npmlog_default.verbose("git", args); return exec("git", args, opts); } export { gitCommit };