1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-16 03:52:12 +02:00

fix: gitignore patching needs leading newline (#2350)

This commit is contained in:
Evan 2021-07-19 10:31:29 -10:00 committed by GitHub
parent 5a65f24fbd
commit d99641f31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ func newInitCmd() *initCmd {
return err
}
defer gitignore.Close()
if _, err := gitignore.WriteString("dist/\n"); err != nil {
if _, err := gitignore.WriteString("\ndist/\n"); err != nil {
return err
}

View File

@ -32,7 +32,7 @@ func TestInitGitIgnoreExists(t *testing.T) {
bts, err := os.ReadFile(".gitignore")
require.NoError(t, err)
require.Equal(t, "mybinary\ndist/\n", string(bts))
require.Equal(t, "mybinary\n\ndist/\n", string(bts))
}
func TestInitFileExists(t *testing.T) {