From 0794337ba676ad4cb30ba5804bd2130b3bd8111e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 7 Nov 2019 21:10:59 +0100 Subject: [PATCH] simplify handling of eth2-clients/eth2-testnets repo [skip ci] --- scripts/connect_to_testnet.nims | 15 +++------------ scripts/reset_testnet.sh | 14 +++----------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/scripts/connect_to_testnet.nims b/scripts/connect_to_testnet.nims index c4c70389c..ba0c8493b 100644 --- a/scripts/connect_to_testnet.nims +++ b/scripts/connect_to_testnet.nims @@ -27,18 +27,9 @@ cli do (testnetName {.argument.}: string): buildDir = rootDir / "build" allTestnetsDir = buildDir / testnetsRepo - if not dirExists(allTestnetsDir): - cd buildDir - exec &"git clone {testnetsRepoGitUrl}" - - cd allTestnetsDir - # Drop all local modifications to make sure the next - # commands won't fail: - exec "git reset --hard HEAD" - # Go in detached state, so we don't try to - exec "git checkout --detach" - exec &"git fetch -f {testnetsRepoGitUrl} master:master" - exec "git checkout master" + rmDir(allTestnetsDir) + cd buildDir + exec &"git clone --quiet {testnetsRepoGitUrl}" let testnetDir = allTestnetsDir / team / testnet if not dirExists(testnetDir): diff --git a/scripts/reset_testnet.sh b/scripts/reset_testnet.sh index 7ae23f598..8e1d35b60 100755 --- a/scripts/reset_testnet.sh +++ b/scripts/reset_testnet.sh @@ -33,17 +33,9 @@ while true; do esac done -if [[ ! -d "$ETH2_TESTNETS" ]]; then - git clone git@github.com:eth2-clients/eth2-testnets "$ETH2_TESTNETS" -fi - -pushd "$ETH2_TESTNETS" - # Make sure we've checked out the very latest master - git reset --hard HEAD - git checkout --detach - git fetch -f origin master:master - git checkout master -popd +rm -rf "$ETH2_TESTNETS" +# "--depth 1" does not make it faster, for such a small repo +git clone --quiet git@github.com:eth2-clients/eth2-testnets "$ETH2_TESTNETS" ETH2_TESTNETS_ABS=$(cd "$ETH2_TESTNETS"; pwd) NETWORK_DIR_ABS="$ETH2_TESTNETS_ABS/nimbus/$NETWORK_NAME"