UNPKG

buddy-bot

Version:

Automated & optimized dependency updates for JavaScript & TypeScript projects. Like Renovate & Dependabot.

5 lines (3 loc) 708 B
// @bun import"./chunk-jcxe2rnh.js";import{spawn as H}from"child_process";async function F(D,A){return new Promise((B,q)=>{let k=H("git",D,{stdio:"pipe",cwd:A}),C="",E="";k.stdout?.on("data",(z)=>C+=z.toString()),k.stderr?.on("data",(z)=>E+=z.toString()),k.on("close",(z)=>{if(z===0)B(C);else q(new Error(E||`git exited with code ${z}`))}),k.on("error",q)})}async function K(D,A,B){for(let q of D){let k=q.path.replace(/^\.\//,"").replace(/^\/+/,"");try{if(await F(["show",`${A}:${k}`],B)!==q.content)return!0;continue}catch{}try{if(await F(["show",`origin/${A}:${k}`],B)!==q.content)return!0;continue}catch{return!0}}return!1}export{K as hasBranchDifferences}; //# debugId=59399D8681E2105C64756E2164756E21