From 6739cb427f2f3d01e32178766d74797db8f74e17 Mon Sep 17 00:00:00 2001 From: oscarzhou Date: Mon, 4 Dec 2023 22:29:18 +1300 Subject: [PATCH] chore(fs): change to a more meaningful function name --- api/filesystem/filesystem.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/filesystem/filesystem.go b/api/filesystem/filesystem.go index d0a715203..dce7890bc 100644 --- a/api/filesystem/filesystem.go +++ b/api/filesystem/filesystem.go @@ -938,7 +938,7 @@ func (service *Service) SafeMoveDirectory(originalPath, newPath string) error { func safeMoveDirectory(src, dst string, copyDirFunc func(string, string, bool) error) error { // 1. Backup the source directory to a different folder backupDir := fmt.Sprintf("%s-%s", src, "backup") - err := moveDirectoryForUpgrade(src, backupDir) + err := moveDirectoryAndOverwrite(src, backupDir) if err != nil { return fmt.Errorf("failed to backup source directory: %w", err) } @@ -1001,7 +1001,7 @@ func MoveDirectory(originalPath, newPath string) error { return os.Rename(originalPath, newPath) } -func moveDirectoryForUpgrade(originalPath, newPath string) error { +func moveDirectoryAndOverwrite(originalPath, newPath string) error { if _, err := os.Stat(originalPath); err != nil { return err }