mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-23 13:00:34 +00:00
fix false positive getopt failure with multiple getopt matches in searched path (#4797)
* fix false positive getopt failure with multiple getopt matches in searched path * also get launch_local_testnet * also make_prometheus_config, called from launch_local_testnet
This commit is contained in:
parent
742de1347d
commit
ed148ab69d
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2020-2022 Status Research & Development GmbH. Licensed under
|
||||
# Copyright (c) 2020-2023 Status Research & Development GmbH. Licensed under
|
||||
# either of:
|
||||
# - Apache License, version 2.0
|
||||
# - MIT license
|
||||
@ -35,7 +35,8 @@ PIDS=""
|
||||
|
||||
GETOPT_BINARY="getopt"
|
||||
if [[ "${OS}" == "macos" ]]; then
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null || true)
|
||||
# Without the head -n1 constraint, it gets confused by multiple matches
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
|
||||
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||
fi
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2020 Status Research & Development GmbH. Licensed under
|
||||
# Copyright (c) 2020-2023 Status Research & Development GmbH. Licensed under
|
||||
# either of:
|
||||
# - Apache License, version 2.0
|
||||
# - MIT license
|
||||
@ -16,7 +16,8 @@ set -e
|
||||
GETOPT_BINARY="getopt"
|
||||
if uname | grep -qi darwin; then
|
||||
# macOS
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null || true)
|
||||
# Without the head -n1 constraint, it gets confused by multiple matches
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
|
||||
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||
fi
|
||||
|
||||
|
@ -17,7 +17,8 @@ KILL_OLD_PROCESSES="0"
|
||||
GETOPT_BINARY="getopt"
|
||||
if uname | grep -qi darwin; then
|
||||
# macOS
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null || true)
|
||||
# Without the head -n1 constraint, it gets confused by multiple matches
|
||||
GETOPT_BINARY=$(find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
|
||||
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user