aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/git/api.py
blob: 629937dfeed9b7f6054ff9a22f46bd650d5730b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


from recipe_engine import recipe_api


class GitApi(recipe_api.RecipeApi):
  def env(self):
    """Add Git to PATH

    Requires the infra/git and infra/tools/git CIPD packages to be installed
    in the 'git' relative path.
    """
    git_dir = self.m.path['start_dir'].join('git')
    git_bin = git_dir.join('bin')
    return self.m.env({'PATH': '%s:%s:%%(PATH)s' % (git_dir, git_bin)})