simplify handling of eth2-clients/eth2-testnets repo [skip ci]
This commit is contained in:
parent
568e669b1c
commit
0794337ba6
|
@ -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):
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue