Check if `git` is installed on this system.
550050
function isGitInstalled() {
    var result = exec( "git --version", true );
    try {
        if ( !result || result.indexOf( "git" ) < 0 || result.indexOf( "version" ) < 0 ) {
            console.log( Fatal.format(
                "`git` is required by the ToloFrameWork!\n" +
                "Please install it:" ) );
            console.log( "\n> " + "sudo apt-get install git".yellow.italic );
            return false;
        }
        return true;
    } catch ( ex ) {
        fatal( "Fatal error in function `result`!\n" + JSON.stringify( ex, null, '  ' ) );
    }
}
253535
def is_installed(path, user=None):
    '''
    
    '''
    retcode = __salt__['cmd.retcode']((
        'wp --path={0} core is-installed'
    ).format(path), runas=user)
    if retcode == 0:
        return True
    return False
92782
def is_git_file(cls, path, name):
        """"""
        os.chdir(path)
        p = subprocess.Popen(['git', 'ls-files', '--error-unmatch', name],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        p.wait()
        return p.returncode == 0
989027
def check_exists_repositories(repo):
    
    pkg_list = "PACKAGES.TXT"
    if repo == "sbo":
        pkg_list = "SLACKBUILDS.TXT"
    if check_for_local_repos(repo) is True:
        pkg_list = "PACKAGES.TXT"
        return ""
    if not os.path.isfile("{0}{1}{2}".format(
            _meta_.lib_path, repo, "_repo/{0}".format(pkg_list))):
        return repo
    return ""
118423
def _check_and_install_rbenv(ret, user=None):
    '''
    
    '''
    ret = _check_rbenv(ret, user)
    if ret['result'] is False:
        if __salt__['rbenv.install'](user):
            ret['result'] = True
            ret['comment'] = 'Rbenv installed'
        else:
            ret['result'] = False
            ret['comment'] = 'Rbenv failed to install'
    else:
        ret['result'] = True
        ret['comment'] = 'Rbenv is already installed'

    return ret
894003
def repo_is_dirty(self):
        
        try:
            subprocess.check_call(['git', 'diff-files', '--quiet'], cwd=self.repo_dir)
            # Return code is 0
            return False
        except subprocess.CalledProcessError:
            return True
622598
def is_installed(prog):
    """"""
    with open(os.devnull, 'w') as devnull:
        try:
            if os.name == 'nt':
                retcode = subprocess.call(['where', prog], stdout=devnull)
            else:
                retcode = subprocess.call(['which', prog], stdout=devnull)
        except OSError as e:
            # If where or which doesn't exist, a "ENOENT" error will occur (The
            # FileNotFoundError subclass on Python 3).
            if e.errno != errno.ENOENT:
                raise
            retcode = 1

    return retcode == 0
194473
def is_installed(config):
    
    try:
        config_utils.get_program("pindel2vcf", config)
        config_utils.get_program("pindel", config)
        return True
    except config_utils.CmdNotFound:
        return False
1027066
def do_install(ctx, verbose, fake):
    """"""
    click.echo('The following git aliases will be installed:\n')
    aliases = cli.list_commands(ctx)
    output_aliases(aliases)

    if click.confirm('\n{}Install aliases above?'.format('FAKE ' if fake else ''), default=fake):
        for alias in aliases:
            cmd = '!legit ' + alias
            system_command = 'git config --global --replace-all alias.{0} "{1}"'.format(alias, cmd)
            verbose_echo(system_command, verbose, fake)
            if not fake:
                os.system(system_command)
        if not fake:
            click.echo("\nAliases installed.")
    else:
        click.echo("\nAliases will not be installed.")
415999
async function isGitRepo(execaOpts) {
  try {
    return (await execa('git', ['rev-parse', '--git-dir'], execaOpts)).code === 0;
  } catch (error) {
    debug(error);
  }
}
579142
def detect!
      installed = {}
      installed_versions.each do |path, version|
        installed[path] = version
        return path if ENV['CLIVER_NO_VERIFY']
        return path if requirement_satisfied_by?(version)
        strict?
      end

      # dependency not met. raise the appropriate error.
      raise_not_found! if installed.empty?
      raise_version_mismatch!(installed)
    end
40094
def using_git(cwd):
    """"""
    try:
        git_log = shell_out(["git", "log"], cwd=cwd)
        return True
    except (CalledProcessError, OSError):  # pragma: no cover
        return False
1120709
def _is_dirty(dir_path):
    """"""
    try:
        subprocess.check_call(["git", "diff", "--quiet"], cwd=dir_path)
        return False
    except subprocess.CalledProcessError:
        return True
530555
def _check_submodule(self):
        

        if (self.path is None or
                (os.path.exists(self.path) and not os.path.isdir(self.path))):
            return False

        if self.use_git:
            return self._check_submodule_using_git()
        else:
            return self._check_submodule_no_git()
519545
def _install(_):
    
    if not os.path.exists(".git"):
        fatal("not in a git repo.")

    config = __load_config()

    if config.get("checks") is None:
        fatal("global ``checks`` variable missing from configuration.")

    # We try to load all checks to check that they exist NOW.
    for hook in config["checks"]:
        checks = __load_checks(config["checks"][hook])
        # Also verify that they apply to the hooks.
        __verify_checks_for_hook(checks, hook)

    reply = input("This will overwrite your current hooks. "
                  "Proceed [yes/No]? ")
    if reply != "yes":
        raise Exit(0)

    for hook in config["checks"]:
        hook_f = open(os.path.join(".git/hooks/", hook), 'w')
        hook_f.write("""#!/usr/bin/env python
# GENRATED BY GLERBL. DO NOT MODIFY.
from glerbl.__main__ import main


exit(main(["glerbl", "hook", "{0}"]))
""".format(hook))
        os.fchmod(hook_f.fileno(),
                  os.fstat(hook_f.fileno()).st_mode | stat.S_IXUSR)
        hook_f.close()
711430
def is_program_installed(basename):
    
    for path in os.environ["PATH"].split(os.pathsep):
        abspath = osp.join(path, basename)
        if osp.isfile(abspath):
            return abspath
960562
def check_gitignore
      gitignore = File.join(`git rev-parse --show-toplevel`.strip, ".gitignore")

      if !File.exist?(gitignore) ||
        File.open(gitignore).read.match(/^#{@options[:config_file]}/i).nil?
        puts "Remember to add #{@options[:config_file]} to your .gitignore."
        false
      else
        true
      end
    end