forked from cpu-chromium/gn_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·38 lines (31 loc) · 1.09 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
trap 'exit' ERR
function getGnHash()
{
local OS_NAME=$1
local FILE_EXT=
if [ "$OS_NAME" == "win" ]; then
eval FILE_EXT=.exe
fi
local hash=`curl https://chromium.googlesource.com/chromium/buildtools/+/master/$OS_NAME/gn$FILE_EXT.sha1 | grep -Po '<td class="FileContents-lineContents" id="1"><span class="pln">\K[A-Za-z0-9]+'`
echo $hash
}
if [ ! -f gsutil/gsutil ]
then
rm -fr gsutil.tar.gz
wget https://commondatastorage.googleapis.com/pub/gsutil.tar.gz
tar zxf gsutil.tar.gz
gsutil/gsutil --version
fi
mkdir -p mac
mkdir -p linux
mkdir -p win
# https://chromium.googlesource.com/chromium/buildtools/+/master/win/gn.exe.sha1
echo "win: $(getGnHash win)"
gsutil/gsutil cp gs://chromium-gn/$(getGnHash win) win/gn.exe
# https://chromium.googlesource.com/chromium/buildtools/+/master/mac/gn.sha1
echo "mac: $(getGnHash mac)"
gsutil/gsutil cp gs://chromium-gn/$(getGnHash mac) mac/gn
# https://chromium.googlesource.com/chromium/buildtools/+/master/linux64/gn.sha1
echo "linux64: $(getGnHash linux64)"
gsutil/gsutil cp gs://chromium-gn/$(getGnHash linux64) linux/gn