From 8e648da3994ac1680b4797fece082b1382ac2f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 11 Jun 2020 04:11:30 +0200 Subject: [PATCH] connect_to_testnet.nims: don't die when GNU getopts is missing --- scripts/connect_to_testnet.nims | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/connect_to_testnet.nims b/scripts/connect_to_testnet.nims index 359143626..be9d2e6f7 100644 --- a/scripts/connect_to_testnet.nims +++ b/scripts/connect_to_testnet.nims @@ -111,12 +111,6 @@ cli do (skipGoerliKey {. echo "Detected testnet restart. Deleting previous database..." rmDir dataDir - cd rootDir - - exec &"""./scripts/make_prometheus_config.sh --nodes 1 --base-metrics-port 8008 --config-file "{dataDir}/prometheus.yml"""" - - exec &"""nim c {nimFlags} -d:"const_preset={preset}" -o:"{beaconNodeBinary}" beacon_chain/beacon_node.nim""" - proc execIgnoringExitCode(s: string) = # reduces the error output when interrupting an external command with Ctrl+C try: @@ -124,6 +118,13 @@ cli do (skipGoerliKey {. except OsError: discard + cd rootDir + + # macOS may not have gnu-getopts installed and in the PATH + execIgnoringExitCode &"""./scripts/make_prometheus_config.sh --nodes 1 --base-metrics-port 8008 --config-file "{dataDir}/prometheus.yml"""" + + exec &"""nim c {nimFlags} -d:"const_preset={preset}" -o:"{beaconNodeBinary}" beacon_chain/beacon_node.nim""" + if not skipGoerliKey and depositContractOpt.len > 0 and not system.dirExists(validatorsDir): mode = Silent echo "\nPlease enter your Goerli Eth1 private key in hex form (e.g. 0x1a2...f3c) in order to become a validator (you'll need access to 32 GoETH)."