gclient 1.15 KB
Newer Older
1 2 3 4 5 6 7 8
#!/bin/sh
# Copyright (c) 2009 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.

# This script will try to sync the bootstrap directories and then defer control.

base_dir=$(dirname "$0")
9 10 11 12

# Update git checkouts prior the cygwin check, we don't want to use msysgit.
if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.git" ]
then
13
  (cd "$base_dir"; git svn rebase -q -q)
14 15 16 17 18 19 20 21 22 23 24 25 26
fi

if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/git-cl-repo/.git" ]
then
  (cd "$base_dir/git-cl-repo"; git pull -q)
fi

if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/git-try-repo/.git" ]
then
  (cd "$base_dir/git-try-repo"; git pull -q)
fi


27
# Use the batch file as an entry point if on cygwin.
28
if [ "${OSTYPE}" = "cygwin" -a "${TERM}" != "xterm" ]; then
29
   ${base_dir}/gclient.bat "$@"
30 31 32
   exit
fi

33

34
# We're on POSIX (not cygwin). We can now safely look for svn checkout.
35 36 37 38
if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ]
then
  # Update the bootstrap directory to stay up-to-date with the latest
  # depot_tools.
39
  svn -q up "$base_dir"
maruel@chromium.org's avatar
maruel@chromium.org committed
40
fi
41 42

exec python "$base_dir/gclient.py" "$@"