File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1515package librarian
1616
1717import (
18+ "bytes"
1819 "encoding/json"
1920 "errors"
2021 "fmt"
@@ -152,11 +153,14 @@ func findServiceConfigIn(path string) (string, error) {
152153
153154func saveLibrarianState (repoDir string , state * config.LibrarianState ) error {
154155 path := filepath .Join (repoDir , config .LibrarianDir , librarianStateFile )
155- bytes , err := yaml .Marshal (state )
156+ var buffer bytes.Buffer
157+ encoder := yaml .NewEncoder (& buffer )
158+ encoder .SetIndent (2 )
159+ err := encoder .Encode (state )
156160 if err != nil {
157161 return err
158162 }
159- return os .WriteFile (path , bytes , 0644 )
163+ return os .WriteFile (path , buffer . Bytes () , 0644 )
160164}
161165
162166// readLibraryState reads the library state from a container response, if it exists.
You can’t perform that action at this time.
0 commit comments