UNPKG

@coveo/semantic-monorepo-tools

Version:

A library of helper functions to do SemVer2 compliant releases from Conventional Commits in monorepos

10 lines (9 loc) 474 B
import spawn from "../utils/spawn.js"; import gitLogger from "./utils/gitLogger.js"; export default async function (remote, completeRef, commitSha1, force = false) { const refPair = `${commitSha1}:${completeRef}`; if (refPair.startsWith("--") || remote.startsWith("--")) { throw new Error(`invalid param:${[remote, completeRef, commitSha1].join(",")}`); } await spawn("git", ["fetch", remote, refPair].concat(force ? ["--force"] : []), gitLogger); }