Skip to content

Commit 70e5422

Browse files
authored
[tmpnet] Update script to run instead of install (#1999)
1 parent 46fbad9 commit 70e5422

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

bin/tmpnetctl

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44

55
set -euo pipefail
66

7-
# Install only if needed
8-
# TODO(marun) Provide tmpnetctl via the nix devshell to ensure a version consistent with the avalanchego dep
9-
if ! command -v tmpnetctl > /dev/null; then
10-
echo "Installing tmpnetctl..."
7+
# Ensure the go command is run from the root of the repository
8+
REPO_ROOT=$(cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
9+
cd "${REPO_ROOT}"
1110

12-
# Ensure the go command is run from the root of the repository
13-
REPO_ROOT=$(cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
14-
cd "${REPO_ROOT}"
11+
# Set AVALANCHE_VERSION
12+
. ./scripts/constants.sh
1513

16-
# Set AVALANCHE_VERSION
17-
. ./scripts/constants.sh
18-
19-
go install github.com/ava-labs/avalanchego/tests/fixture/tmpnet/tmpnetctl@"${AVALANCHE_VERSION}"
20-
fi
21-
tmpnetctl "${@}"
14+
echo "Running tmpnetctl @ ${AVALANCHE_VERSION}"
15+
go run github.com/ava-labs/avalanchego/tests/fixture/tmpnet/tmpnetctl@"${AVALANCHE_VERSION}" "${@}"

0 commit comments

Comments
 (0)