INNER CODE UNIT · TypeScript

isGitInPath

hypermodeinc/modus · cli/src/commands/new/index.ts:398

async function isGitInPath() {
  try {
    await exec("git --version");
    return true;
  } catch {
    return false;
  }
}

async function isInGitRepo(dir: string) {
  try {
    await exec("git rev-parse --is-inside-work-tree", { cwd: dir });

    return true;
  } catch {
    return false;
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…