diff --git a/goreleaserlib/goreleaser.go b/goreleaserlib/goreleaser.go index 9f6c37dc7..9208fdd1d 100644 --- a/goreleaserlib/goreleaser.go +++ b/goreleaserlib/goreleaser.go @@ -40,8 +40,8 @@ func init() { var pipes = []pipeline.Piper{ defaults.Pipe{}, // load default configs dist.Pipe{}, // ensure ./dist is clean - effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist git.Pipe{}, // get and validate git repo state + effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist changelog.Pipe{}, // builds the release changelog env.Pipe{}, // load and validate environment variables build.Pipe{}, // build diff --git a/pipeline/dist/dist.go b/pipeline/dist/dist.go index 760689463..72eb1a31a 100644 --- a/pipeline/dist/dist.go +++ b/pipeline/dist/dist.go @@ -49,5 +49,5 @@ func (Pipe) Run(ctx *context.Context) (err error) { } func mkdir(ctx *context.Context) error { - return os.Mkdir(ctx.Config.Dist, 0755) + return os.MkdirAll(ctx.Config.Dist, 0755) } diff --git a/pipeline/dist/dist_test.go b/pipeline/dist/dist_test.go index cbeb0f556..ffff99e88 100644 --- a/pipeline/dist/dist_test.go +++ b/pipeline/dist/dist_test.go @@ -12,12 +12,15 @@ import ( ) func TestDistDoesNotExist(t *testing.T) { + folder, err := ioutil.TempDir("", "disttest") + assert.NoError(t, err) + var dist = filepath.Join(folder, "dist") assert.NoError( t, Pipe{}.Run( &context.Context{ Config: config.Project{ - Dist: "/wtf-this-shouldnt-exist", + Dist: dist, }, }, ), @@ -55,7 +58,7 @@ func TestEmptyDistExists(t *testing.T) { } assert.NoError(t, Pipe{}.Run(ctx)) _, err = os.Stat(dist) - assert.False(t, os.IsExist(err)) + assert.False(t, os.IsNotExist(err)) } func TestDescription(t *testing.T) {