eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 375 B
JavaScript
import{execSync}from"node:child_process";function resolveLocalGitMetadata(e){let t=execGitCommand(`git rev-parse HEAD`,e);return{branch:execGitCommand(`git branch --show-current`,e)||void 0,sha:t||void 0}}function execGitCommand(t,n){try{return execSync(t,{cwd:n,encoding:`utf8`,stdio:[`pipe`,`pipe`,`pipe`],timeout:5e3}).trim()}catch{return}}export{resolveLocalGitMetadata};