blob: f2adb86e9506aa7ede16ee95a9ebf39570a934b5 [file] [log] [blame]
Dan Jacques35c5b9a2017-09-28 21:58:22 -04001#!/usr/bin/env bash
2
3# Copyright 2017 The Chromium Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# This is a shell script to ensure that all of the "depot_tools" bootstrap
8# programs are locally downloaded and ready for execution.
9#
10# Unlike "update_depot_tools", this script works with the current
11# checkout, and will not update/sync the "depot_tools" repository.
12#
13# TODO: This duplicates logic in "update_depot_tools". Update that script to
14# invoke this script instead of manually calling "cipd_bin_setup" and other
15# operations.
16
17# Test if this script is running under a MinGW install. If it is, we will
18# hardcode the paths to Git where possible.
19OUTPUT="$(uname | grep 'MINGW')"
20MINGW=$?
21
22if [ $MINGW = 0 ]; then
23 base_dir="${0%/*}"
24else
25 base_dir=$(dirname "${BASH_SOURCE[0]}")
26 if [ -L "$base_dir" ]; then
27 base_dir=`cd "$base_dir" && pwd -P`
28 fi
29fi
30
31# Sync CIPD-boostrapped packages.
32source "$base_dir/cipd_bin_setup.sh"
33cipd_bin_setup
34
35# Sync "gsutil.py".
36python "$base_dir/gsutil.py" -- version 1> /dev/null
37
38# Cleanup.
39find "$base_dir" -iname "*.pyc" -delete || true