mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
reorder
This commit is contained in:
parent
a6822c53ab
commit
44d9ddd104
@ -57,7 +57,7 @@ func runHook(env []string, hook string) error {
|
||||
}
|
||||
log.Println("Running hook", hook)
|
||||
cmd := strings.Fields(hook)
|
||||
return run(env, runtimeTarget, cmd)
|
||||
return run(runtimeTarget, cmd, env)
|
||||
}
|
||||
|
||||
func build(ctx *context.Context, name string, target buildTarget) error {
|
||||
@ -76,10 +76,10 @@ func build(ctx *context.Context, name string, target buildTarget) error {
|
||||
return err
|
||||
}
|
||||
cmd = append(cmd, "-ldflags="+flags, "-o", output, ctx.Config.Build.Main)
|
||||
return run(ctx.Config.Build.Env, target, cmd)
|
||||
return run(target, cmd, ctx.Config.Build.Env)
|
||||
}
|
||||
|
||||
func run(env []string, target buildTarget, command []string) error {
|
||||
func run(target buildTarget, command, env []string) error {
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Env = append(cmd.Env, os.Environ()...)
|
||||
cmd.Env = append(cmd.Env, env...)
|
||||
|
@ -19,11 +19,11 @@ func TestPipeDescription(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
assert.NoError(t, run(emptyEnv, runtimeTarget, []string{"go", "list", "./..."}))
|
||||
assert.NoError(t, run(runtimeTarget, []string{"go", "list", "./..."}, emptyEnv))
|
||||
}
|
||||
|
||||
func TestRunInvalidCommand(t *testing.T) {
|
||||
assert.Error(t, run(emptyEnv, runtimeTarget, []string{"gggggo", "nope"}))
|
||||
assert.Error(t, run(runtimeTarget, []string{"gggggo", "nope"}, emptyEnv))
|
||||
}
|
||||
|
||||
func TestBuild(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user