From 43b4a7b7c8bc6697d0f67da4caa330600cc533f7 Mon Sep 17 00:00:00 2001 From: Theo Diamantidis Date: Sun, 22 Oct 2023 01:36:49 +0300 Subject: [PATCH] dev: add moveResolvedFile extension to File methods that moves the symlink target instead of the symlink itself --- lib/src/utils/extensions/file_move.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/utils/extensions/file_move.dart b/lib/src/utils/extensions/file_move.dart index 726cecc..023fd8a 100644 --- a/lib/src/utils/extensions/file_move.dart +++ b/lib/src/utils/extensions/file_move.dart @@ -14,4 +14,9 @@ extension FileMoveExt on FileSystemEntity { return newFile; } } + + Future moveResolvedFile(String newPath) async { + final resolvedFile = File(toFile.resolveSymbolicLinksSync()); + return await resolvedFile.moveFile(newPath); + } }