copyDirectoryImpl function
Implementation
Future<int> copyDirectoryImpl(
Directory src,
Directory? dst, {
CopyOptions? options,
}) async {
options ??= defaultCopyOptions;
if (await src.fs.isDirectory(src.path)) {
// delete destination first?
if (options.delete) {
await deleteDirectory(dst!);
}
return await TopCopy(
TopEntity(src.fs, src.path),
TopEntity(dst!.fs, dst.path),
options: options,
).run();
} else {
throw ArgumentError('not a directory ($src)');
}
}