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:
parent
5a65f24fbd
commit
d99641f31e
@ -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
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user