Commit a42b2a0 1 parent 618a6f8 commit a42b2a0 Copy full SHA for a42b2a0
File tree 3 files changed +20
-9
lines changed
3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ echo "Building tmpnetctl..."
12
12
go build -ldflags\
13
13
" -X github.com/ava-labs/avalanchego/version.GitCommit=$git_commit $static_ld_flags " \
14
14
-o " $AVALANCHE_PATH /build/tmpnetctl" \
15
- " $AVALANCHE_PATH /tests/fixture/tmpnet/cmd /" * .go
15
+ " $AVALANCHE_PATH /tests/fixture/tmpnet/tmpnetctl /" * .go
Original file line number Diff line number Diff line change @@ -444,16 +444,27 @@ flake that inherits from the avalanchego flake:
444
444
}
445
445
```
446
446
447
- The action also requires being able to invoke tmpnetctl via `go
448
- run` . Use of a ` tools.go` file that imports tmpnetctl is suggested to
449
- enable this:
447
+ The action expects to be able to run bin/tmpnetctl from the root of
448
+ the repository. A suggested version of this script:
450
449
451
- ``` golang
452
- package tools
450
+ ``` bash
451
+ #! /usr/bin/env bash
453
452
454
- import (
455
- _ " github.com/ava-labs/avalanchego/tests/fixture/tmpnet/cmd" // tmpnetctl
456
- )
453
+ set -euo pipefail
454
+
455
+ # Ensure the go command is run from the root of the repository
456
+ REPO_ROOT=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; cd .. && pwd )
457
+ cd " ${REPO_ROOT} "
458
+
459
+ # Set AVALANCHE_VERSION
460
+ source ./scripts/versions.sh
461
+
462
+ # Install if not already available
463
+ if command -v tmpnetctl & 2> /dev/null; then
464
+ # An explicit version is required since a main package can't be included as a dependency of the go module.
465
+ go install github.com/ava-labs/avalanchego/tests/fixture/tmpnet/tmpnetctl@${AVALANCHE_VERSION}
466
+ fi
467
+ tmpnetctl " ${@ } "
457
468
```
458
469
459
470
### Viewing
File renamed without changes.
You can’t perform that action at this time.
0 commit comments