diff --git a/bootstrap.sh b/bootstrap.sh
index 4e05477..cb1a181 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,9 +1,20 @@
#!/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 '
\K[A-Za-z0-9]+'`
+ echo $hash
+}
+
if [ ! -f gsutil/gsutil ]
then
- rm gsutil.tar.gz
+ rm -fr gsutil.tar.gz
wget https://commondatastorage.googleapis.com/pub/gsutil.tar.gz
tar zxf gsutil.tar.gz
gsutil/gsutil --version
@@ -14,11 +25,14 @@ mkdir -p linux
mkdir -p win
# https://chromium.googlesource.com/chromium/buildtools/+/master/win/gn.exe.sha1
-gsutil/gsutil cp gs://chromium-gn/1380b36db64aace2523d6bea32c59e48a51c82a4 win/gn.exe
+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
-gsutil/gsutil cp gs://chromium-gn/a68b194afb05d6a6357cf2e2464136ed7723c305 mac/gn
+echo "mac: $(getGnHash mac)"
+gsutil/gsutil cp gs://chromium-gn/$(getGnHash mac) mac/gn
# https://chromium.googlesource.com/chromium/buildtools/+/master/linux64/gn.sha1
-gsutil/gsutil cp gs://chromium-gn/4e3a214794b25c37e57b8c690c0b24daa631a420 linux/gn
+echo "linux64: $(getGnHash linux64)"
+gsutil/gsutil cp gs://chromium-gn/$(getGnHash linux64) linux/gn
|