Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 # Copyright 2015 The LUCI Authors. All rights reserved. | |
|
tandrii(chromium)
2016/06/16 18:30:45
nit2016
mithro
2016/06/17 05:05:35
Done.
| |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | |
| 4 # that can be found in the LICENSE file. | |
| 5 | |
| 6 set -e | |
| 7 | |
| 8 mkdir cr-infra-go-area | |
| 9 cd cr-infra-go-area | |
| 10 | |
| 11 # Download depot_tools | |
| 12 echo "Getting Chromium depot_tools.." | |
| 13 git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot _tools | |
| 14 echo | |
| 15 | |
| 16 echo "Fetching the infra build..." | |
| 17 "$PWD/depot_tools/fetch" infra | |
| 18 | |
| 19 echo "Creating enter script..." | |
| 20 # Create a bashrc include file | |
| 21 ENTER_SCRIPT=$PWD/enter-env.sh | |
| 22 cat > $ENTER_SCRIPT <<EOF | |
| 23 #!/bin/bash | |
| 24 [[ "\${BASH_SOURCE[0]}" != "\${0}" ]] && SOURCED=1 || SOURCED=0 | |
| 25 if [ \$SOURCED = 0 ]; then | |
| 26 exec bash --init-file $ENTER_SCRIPT | |
| 27 fi | |
| 28 | |
| 29 if [ -f ~/.bashrc ]; then . ~/.bashrc; fi | |
| 30 | |
| 31 export DEPOT_TOOLS="$PWD/depot_tools" | |
| 32 export PATH="\$DEPOT_TOOLS:\$PATH" | |
| 33 export PS1="[cr-infra-go-area] \$PS1" | |
| 34 | |
| 35 cd $PWD/infra/go | |
| 36 eval \$($PWD/infra/go/env.py) | |
| 37 | |
| 38 echo "Entered cr-infra-go-area setup at '$PWD'" | |
| 39 cd "$PWD/infra/go/src/github.com/luci/luci-go" | |
| 40 EOF | |
| 41 chmod a+x $ENTER_SCRIPT | |
| 42 | |
| 43 # Running the env setup for the first time | |
| 44 source $ENTER_SCRIPT | |
| 45 | |
| 46 # Output usage instructions | |
| 47 if [ -d ~/bin ]; then | |
| 48 ln -sf $ENTER_SCRIPT ~/bin/cr-infra-go-area-enter | |
| 49 if which cr-infra-go-area-enter; then | |
| 50 echo "Enter the environment by running 'cr-infra-go-area-enter'" | |
| 51 exit 0 | |
| 52 fi | |
| 53 fi | |
| 54 echo "Enter the environment by running '$PWD/enter-env.sh'" | |
| OLD | NEW |