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

Function backupExistingFile

internal/instructions/install.go:156–160  ·  view source on GitHub ↗

backupExistingFile renames target to target.backup. .

(target string)

Source from the content-addressed store, hash-verified

154
155// backupExistingFile renames target to target.backup.<YYYYMMDD-HHMMSS>.
156func backupExistingFile(target string) error {
157 ts := time.Now().Local().Format("20060102-150405")
158 backup := target + ".backup." + ts
159 return os.Rename(target, backup)
160}
161
162// instructionForFile returns the instruction whose managed file equals path.
163func (s *Store) instructionForFile(ctx context.Context, path string) (Instruction, bool) {

Callers 1

checkConflictMethod · 0.85

Calls 2

FormatMethod · 0.65
RenameMethod · 0.45

Tested by

no test coverage detected