MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / write

Method write

internal/entities/store.go:175–188  ·  view source on GitHub ↗
(all map[string]Entity)

Source from the content-addressed store, hash-verified

173}
174
175func (s *Store) write(all map[string]Entity) error {
176 if err := os.MkdirAll(s.dir, 0o755); err != nil {
177 return fmt.Errorf("entities: mkdir %s: %w", s.dir, err)
178 }
179 data, err := json.MarshalIndent(all, "", " ")
180 if err != nil {
181 return fmt.Errorf("entities: marshal: %w", err)
182 }
183 data = append(data, '\n')
184 if err := os.WriteFile(s.Path(), data, 0o600); err != nil {
185 return fmt.Errorf("entities: write %s: %w", s.Path(), err)
186 }
187 return nil
188}
189
190func (s *Store) migrateIfInstruction() error {
191 if s.kind != KindInstruction {

Callers 2

PutMethod · 0.95
DeleteMethod · 0.95

Calls 1

PathMethod · 0.95

Tested by

no test coverage detected