blob: 639ecfbbe97bf716d4efa0b23b531b2f0f22fbb9 [file] [log] [blame]
maruel@google.comfb2b8eb2009-04-23 21:03:42 +00001#!/bin/sh
2# Copyright (c) 2009 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# This script will try to sync the bootstrap directories and then defer control.
7
8base_dir=$(dirname "$0")
maruel@chromium.org0a3488a2009-06-17 18:03:50 +00009
maruel@chromium.orgcf1e53b2009-05-07 02:56:13 +000010# Use the batch file as an entry point if on cygwin.
maruel@chromium.org775a79c2009-06-17 13:10:48 +000011if [ "${OSTYPE}" = "cygwin" -a "${TERM}" = "cygwin" ]; then
maruel@chromium.orgbeffe122009-06-09 20:28:23 +000012 ${base_dir}/gclient.bat "$@"
maruel@chromium.orgcf1e53b2009-05-07 02:56:13 +000013 exit
14fi
15
maruel@google.comfb2b8eb2009-04-23 21:03:42 +000016
17if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ]
18then
19 # Update the bootstrap directory to stay up-to-date with the latest
20 # depot_tools.
maruel@chromium.org0a3488a2009-06-17 18:03:50 +000021 svn -q up "$base_dir/bootstrap"
maruel@chromium.org25a80812009-06-17 17:59:38 +000022
maruel@chromium.org0a3488a2009-06-17 18:03:50 +000023 # Then defer the control to the bootstrapper.
24 exec "$base_dir/bootstrap/gclient.sh" "$@"
25else
26 exec python "$base_dir/gclient.py" "$@"
27fi