MCPcopy Create free account
hub / github.com/conventional-changelog/commitlint / main

Function main

@commitlint/travis-cli/src/cli.ts:32–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30});
31
32async function main() {
33 validate();
34
35 // Stash changes in working copy if needed
36 const pop = await stash();
37
38 // Make base and source available as dedicated remotes
39 await Promise.all([
40 () => fetch({ name: "base", url: `https://github.com/${REPO_SLUG}.git` }),
41 IS_PR
42 ? () => fetch({ name: "source", url: `https://github.com/${PR_SLUG}.git` })
43 : () => Promise.resolve(),
44 ]);
45
46 // Restore stashed changes if any
47 await pop();
48
49 const args = process.argv.slice(2);
50
51 // Lint all commits in TRAVIS_COMMIT_RANGE if available
52 if (IS_PR && RANGE) {
53 const [start, end] = RANGE.split(".").filter(Boolean);
54 await lint(["--from", start, "--to", end, ...args]);
55 } else {
56 const input = await log(COMMIT);
57 await lint(args, {}, input);
58 }
59}
60
61async function git(args: string[], nodeOptions: SpawnOptions = {}) {
62 return x(GIT, args, {

Callers 1

cli.tsFile · 0.70

Calls 7

stashFunction · 0.85
fetchFunction · 0.85
resolveMethod · 0.80
filterMethod · 0.80
validateFunction · 0.70
lintFunction · 0.70
logFunction · 0.70

Tested by

no test coverage detected