Created
February 29, 2020 12:17
-
-
Save bsutton/e73972c5530b8485b974ee8334d2297e to your computer and use it in GitHub Desktop.
Copy directory tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void copyTree(String fromPath, String toPath) { | |
var list = find( | |
'*', | |
root: from, | |
recursive: true, | |
).toList(); | |
for (var file in list) { | |
var target = join(toPath, relative(file, from: fromPath)); | |
if (!exists(dirname(target))) createDir(dirname(target), recursive: true); | |
copy(file, target); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment