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
|
#!/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:
|
# either of:
|
||||||
# - Apache License, version 2.0
|
# - Apache License, version 2.0
|
||||||
# - MIT license
|
# - MIT license
|
||||||
|
@ -35,7 +35,8 @@ PIDS=""
|
||||||
|
|
||||||
GETOPT_BINARY="getopt"
|
GETOPT_BINARY="getopt"
|
||||||
if [[ "${OS}" == "macos" ]]; then
|
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; }
|
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/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:
|
# either of:
|
||||||
# - Apache License, version 2.0
|
# - Apache License, version 2.0
|
||||||
# - MIT license
|
# - MIT license
|
||||||
|
@ -16,7 +16,8 @@ set -e
|
||||||
GETOPT_BINARY="getopt"
|
GETOPT_BINARY="getopt"
|
||||||
if uname | grep -qi darwin; then
|
if uname | grep -qi darwin; then
|
||||||
# macOS
|
# 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; }
|
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ KILL_OLD_PROCESSES="0"
|
||||||
GETOPT_BINARY="getopt"
|
GETOPT_BINARY="getopt"
|
||||||
if uname | grep -qi darwin; then
|
if uname | grep -qi darwin; then
|
||||||
# macOS
|
# 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; }
|
[[ -f "$GETOPT_BINARY" ]] || { echo "GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting."; exit 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue