MCPcopy
hub / github.com/mruniquehacker/Knightbot-MD / hasGitRepo

Function hasGitRepo

commands/update.js:17–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17async function hasGitRepo() {
18 const gitDir = path.join(process.cwd(), '.git');
19 if (!fs.existsSync(gitDir)) return false;
20 try {
21 await run('git --version');
22 return true;
23 } catch {
24 return false;
25 }
26}
27
28async function updateViaGit() {
29 const oldRev = (await run('git rev-parse HEAD').catch(() => 'unknown')).trim();

Callers 1

updateCommandFunction · 0.85

Calls 1

runFunction · 0.85

Tested by

no test coverage detected