Skip to content

Commit

Permalink
Enforce YAML document starter in split
Browse files Browse the repository at this point in the history
In order to have the same behavior as other commands, the file that is
created by a split should start with a YAML document start `---`.

Add `---` start to be placed before each file.
  • Loading branch information
HeavyWombat committed Nov 16, 2020
1 parent 5461a5c commit 1054351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var splitCmd = &cobra.Command{
return err
}

if err := ioutil.WriteFile(filename, bytes, stat.Mode()); err != nil {
if err := ioutil.WriteFile(filename, append([]byte("---\n"), bytes...), stat.Mode()); err != nil {
return err
}
}
Expand Down

0 comments on commit 1054351

Please sign in to comment.