0.0.12 • Published 5 years ago

has-git v0.0.12

Weekly downloads
90
License
MIT
Repository
github
Last release
5 years ago

has-git

hasGit(cwd): Promise<T | F>

  • Checks whether git is initialized for the project.

getConfig(cwd): Promise<{}>

  • Returns the project's git config with git config --list

isDirty(cwd): Promise<T | F>

  • Checks whether the project has untracked changes. Does not check for untracked files.
const { hasGit, getConfig, isDirty } = require('has-git')

hasGit().then(result => {
  console.log(result) // true
})

getConfig().then(result => {
  console.log(result) 
  /*
  {
    user: { 
      name: 'Steve', 
      email: 'steve@apple.com' 
    },
    core: { 
      repositoryformatversion: '0',
      filemode: 'true',
      bare: 'false',
      logallrefupdates: 'true',
      ignorecase: 'true',
      precomposeunicode: 'true' 
    },
    remote: { 
      origin: { 
        url: 'https://github.com/unshift/has-git.git',
        fetch: '+refs/heads/*:refs/remotes/origin/*' 
      } 
    } 
  }
  */
})

isDirty().then(result => {
  console.log(result) // true if untracked changes are present
})
0.0.12

5 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago