mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: not using go mods on go 1.15
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
f6b1d1563a
commit
50117da6b5
@ -42,14 +42,13 @@ func (Pipe) Default(ctx *context.Context) error {
|
||||
// Run the pipe.
|
||||
func (Pipe) Run(ctx *context.Context) error {
|
||||
out, err := exec.CommandContext(ctx, ctx.Config.GoMod.GoBinary, "list", "-m").CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get module path: %w: %s", err, string(out))
|
||||
}
|
||||
|
||||
result := strings.TrimSpace(string(out))
|
||||
if result == go115NotAGoModuleError || result == go116NotAGoModuleError {
|
||||
return pipe.Skip("not a go module")
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get module path: %w: %s", err, string(out))
|
||||
}
|
||||
|
||||
ctx.ModulePath = result
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user