simplify handling of eth2-clients/eth2-testnets repo [skip ci]

This commit is contained in:
Ștefan Talpalaru 2019-11-07 21:10:59 +01:00
parent 568e669b1c
commit 0794337ba6
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 6 additions and 23 deletions

View File

@ -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):

View File

@ -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"