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" buildDir = rootDir / "build"
allTestnetsDir = buildDir / testnetsRepo allTestnetsDir = buildDir / testnetsRepo
if not dirExists(allTestnetsDir): rmDir(allTestnetsDir)
cd buildDir cd buildDir
exec &"git clone {testnetsRepoGitUrl}" exec &"git clone --quiet {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"
let testnetDir = allTestnetsDir / team / testnet let testnetDir = allTestnetsDir / team / testnet
if not dirExists(testnetDir): if not dirExists(testnetDir):

View File

@ -33,17 +33,9 @@ while true; do
esac esac
done done
if [[ ! -d "$ETH2_TESTNETS" ]]; then rm -rf "$ETH2_TESTNETS"
git clone git@github.com:eth2-clients/eth2-testnets "$ETH2_TESTNETS" # "--depth 1" does not make it faster, for such a small repo
fi git clone --quiet git@github.com:eth2-clients/eth2-testnets "$ETH2_TESTNETS"
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
ETH2_TESTNETS_ABS=$(cd "$ETH2_TESTNETS"; pwd) ETH2_TESTNETS_ABS=$(cd "$ETH2_TESTNETS"; pwd)
NETWORK_DIR_ABS="$ETH2_TESTNETS_ABS/nimbus/$NETWORK_NAME" NETWORK_DIR_ABS="$ETH2_TESTNETS_ABS/nimbus/$NETWORK_NAME"