blob: 32e7c3c68d8d11dca518c11251b588489a92e9f2 [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.
Edward Lemurf73f0f42019-09-16 22:23:45 +000012#
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.
Dan Jacques35c5b9a2017-09-28 21:58:22 -040016
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
Mike Frysinger53297792019-08-20 21:32:33 +000038# Sync all the pylint versions.
39for script in "$base_dir"/pylint-[0-9].[0-9]; do
40 # We have to silence stderr too because newer pylint versions will emit
41 # a spurious log to tell us what pylintrc file it's using. Ugh.
42 "$script" --version >/dev/null 2>&1
43done
44
Dan Jacques35c5b9a2017-09-28 21:58:22 -040045# Cleanup.
46find "$base_dir" -iname "*.pyc" -delete || true