MCPcopy
hub / github.com/antfu/skills / execSafe

Function execSafe

scripts/cli.ts:16–23  ·  view source on GitHub ↗
(cmd: string, cwd = root)

Source from the content-addressed store, hash-verified

14}
15
16function execSafe(cmd: string, cwd = root): string | null {
17 try {
18 return exec(cmd, cwd)
19 }
20 catch {
21 return null
22 }
23}
24
25function getGitSha(dir: string): string | null {
26 return execSafe('git rev-parse HEAD', dir)

Callers 3

getGitShaFunction · 0.85
removeSubmoduleFunction · 0.85
checkUpdatesFunction · 0.85

Calls 1

execFunction · 0.85

Tested by

no test coverage detected