mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
013bd69126
Currently, the 'goVersion' function is run without any directory set. This is problematic when a build uses the 'dir' config in combination with the 'gobinary' config. When 'gobinary' is a relative path (like a script in the current repository), goVersion silently fails, returning an empty string. This commit refactors 'goVersion' to execute the command with '.Dir' set to the 'build.Dir', in addition to now returning an error, so that issues may be bubbled up in the build log, rather than silently failing. It also adds a new helper function to facilitate running 'goVersion' by creating a temporary executable that outputs a given 'version' string. This function is only currently used by 'TestWithDefaults'. Co-authored-by: Rob Prentiss <prentiss@apple.com> |
||
---|---|---|
.. | ||
build_test.go | ||
build.go |