How to use the parse-git-config function in parse-git-config

To help you get started, we’ve selected a few parse-git-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github garden-io / garden / garden-service / src / vcs / git.ts View on Github external
private async getSubmodules(gitRoot: string) {
    const submodules: Submodule[] = []
    const gitmodulesPath = join(gitRoot, ".gitmodules")

    if (await pathExists(gitmodulesPath)) {
      const parsed = await parseGitConfig({ cwd: gitRoot, path: ".gitmodules" })

      for (const [key, spec] of Object.entries(parsed || {}) as any) {
        if (!key.startsWith("submodule")) {
          continue
        }
        spec.path && submodules.push(spec)
      }
    }

    return submodules
  }

parse-git-config

Parse `.git/config` into a JavaScript object. sync or async.

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis