We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a57e5fd commit 3532f19Copy full SHA for 3532f19
1 file changed
internal/librarian/state.go
@@ -15,6 +15,7 @@
15
package librarian
16
17
import (
18
+ "bytes"
19
"encoding/json"
20
"errors"
21
"fmt"
@@ -152,11 +153,14 @@ func findServiceConfigIn(path string) (string, error) {
152
153
154
func saveLibrarianState(repoDir string, state *config.LibrarianState) error {
155
path := filepath.Join(repoDir, config.LibrarianDir, librarianStateFile)
- bytes, err := yaml.Marshal(state)
156
+ var buffer bytes.Buffer
157
+ encoder := yaml.NewEncoder(&buffer)
158
+ encoder.SetIndent(2)
159
+ err := encoder.Encode(state)
160
if err != nil {
161
return err
162
}
- return os.WriteFile(path, bytes, 0644)
163
+ return os.WriteFile(path, buffer.Bytes(), 0644)
164
165
166
// readLibraryState reads the library state from a container response, if it exists.
0 commit comments