warp-task-master
Version:
BETA: Experimental Task Master fork with Warp AI integration and human-readable profile names. For production use, see task-master-ai.
1 lines • 1.12 kB
JavaScript
import e from"path";import t from"fs";import{exec as n,execSync as r}from"child_process";import{promisify as i}from"util";const a=i(n);async function o(e){if(!e)throw Error(`projectRoot is required for isGitRepository`);try{return await a(`git rev-parse --git-dir`,{cwd:e}),!0}catch(e){return!1}}async function s(e){if(!e)throw Error(`projectRoot is required for getCurrentBranch`);try{let{stdout:t}=await a(`git rev-parse --abbrev-ref HEAD`,{cwd:e});return t.trim()}catch(e){return null}}function c(e){return!e||typeof e!=`string`?`unknown-branch`:e.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/^-+|-+$/g,``).replace(/-+/g,`-`).toLowerCase().substring(0,50)}function l(e){if(!e||typeof e!=`string`||[`main`,`master`,`develop`,`dev`,`HEAD`].includes(e.toLowerCase()))return!1;let t=c(e);return t.length>0&&t!==`unknown-branch`}function u(e,t){}function d(){try{return r(`git rev-parse --is-inside-work-tree`,{stdio:`ignore`,cwd:process.cwd()}),!0}catch{return!1}}export{u as checkAndAutoSwitchGitTagSync,s as getCurrentBranch,d as insideGitWorkTree,o as isGitRepository,l as isValidBranchForTag,c as sanitizeBranchNameForTag};