mirror of
https://github.com/Adembc/lazyssh.git
synced 2026-07-14 12:13:34 +02:00
feat: backup the original file before manage it by lazyssh (#49)
This commit is contained in:
@@ -66,6 +66,11 @@ func (r *Repository) saveConfig(cfg *ssh_config.Config) error {
|
||||
return fmt.Errorf("failed to write config to temporary file: %w", err)
|
||||
}
|
||||
|
||||
// Ensure a one-time original backup exists before any modifications managed by lazyssh.
|
||||
if err := r.createOriginalBackupIfNeeded(); err != nil {
|
||||
return fmt.Errorf("failed to create original backup: %w", err)
|
||||
}
|
||||
|
||||
if err := r.createBackup(); err != nil {
|
||||
return fmt.Errorf("failed to create backup: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user