From 560e0535e192426088e46f8157863981ed928e6a Mon Sep 17 00:00:00 2001 From: toki Date: Sun, 19 Feb 2023 07:30:12 +0900 Subject: [PATCH] =?UTF-8?q?move=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/path.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/utils/path.dart b/lib/utils/path.dart index 2e1bd53..1898cb3 100644 --- a/lib/utils/path.dart +++ b/lib/utils/path.dart @@ -44,7 +44,8 @@ class Path { static Future copy(String startPath, String destPath, bool isDir, {required List? ignorePattern, - required List? ignoredList}) async { + required List? ignoredList, + bool isMove = false}) async { var c = Completer(); var result = true; if (ignorePattern != null) { @@ -78,7 +79,11 @@ class Path { var destDir = Directory(destPath); if (!destDir.existsSync()) destDir.createSync(recursive: true); print('File copy: $startPath --> $destChildPath'); - await File(startPath).copy(destChildPath); + var file = File(startPath); + await file.copy(destChildPath); + if (isMove) { + file.delete(recursive: true); + } } } on Exception catch (e) { result = false;