MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getGitRepoRoot

Function getGitRepoRoot

packages/cli/src/utils/gitUtils.ts:38–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 * @throws error if the exec command fails.
37 */
38export const getGitRepoRoot = (): string => {
39 const gitRepoRoot = (
40 execSync('git rev-parse --show-toplevel', {
41 encoding: 'utf-8',
42 }) || ''
43 ).trim();
44
45 if (!gitRepoRoot) {
46 throw new Error(`Git repo returned empty value`);
47 }
48
49 return gitRepoRoot;
50};
51
52/**
53 * getLatestGitHubRelease returns the release tag as a string.

Callers 2

gitUtils.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected