Skip to content

Commit

Permalink
try with || true, with an explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-mm committed Sep 28, 2023
1 parent 4f9ddfe commit 8ec52c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ function initialize {
# install go ascii

if [[ $install_go == true ]]; then
go mod init
go install github.com/guptarohit/asciigraph/cmd/asciigraph@latest 2>/dev/null
# || true here because this line technically fails with:
# no required module provides package github.com/guptarohit/asciigraph/cmd/asciigraph: go.mod file not found in current directory or any parent directory; see 'go help modules'
# the solution would be either to `go mod init` to create a go.mod file for this directory... but are not making a go package here so this doesn't seem appropriate
# the other solution would be to set the environment variable `go env -w GO111MODULE=auto`... but I can't seem to get any already-set value ahead of time reliably, and do not want to overwrite
# any user environment settings.
# So, we ignore this error for now, as functionally the asciigraph still is installed and works for Eco-CI
go install github.com/guptarohit/asciigraph/cmd/asciigraph@latest || true
ascii_graph_path=$(go list -f '{{.Target}}' github.com/guptarohit/asciigraph/cmd/asciigraph)
fi

Expand Down

0 comments on commit 8ec52c6

Please sign in to comment.