From 636c1dc86d04075e0bbbab29a86de4568148253c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 4 Feb 2020 22:39:15 +0100 Subject: [PATCH] Only download compat-table if it's not already downloaded (#11081) * Only download compat-table if it's not already downloaded * Use git rev-parse --- .../scripts/download-compat-table.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/babel-compat-data/scripts/download-compat-table.sh b/packages/babel-compat-data/scripts/download-compat-table.sh index c809412a0b..cc5ba63d81 100755 --- a/packages/babel-compat-data/scripts/download-compat-table.sh +++ b/packages/babel-compat-data/scripts/download-compat-table.sh @@ -2,6 +2,18 @@ set -e COMPAT_TABLE_COMMIT=4e9369a699b0e15ba5c21586ce3bdd34299db9c1 +GIT_HEAD=build/compat-table/.git/HEAD + +if [ -d "build/compat-table" ]; then + cd build/compat-table + commit="$(git rev-parse HEAD)" + cd ../.. + + if [ $commit == $COMPAT_TABLE_COMMIT ]; then + exit 0 + fi +fi + rm -rf build/compat-table mkdir -p build git clone --branch=gh-pages --single-branch --shallow-since=2019-11-14 https://github.com/kangax/compat-table.git build/compat-table