superunitybuild / buildactions

BuildActions for use with the SuperUnityBuild build automation tool.
https://github.com/superunitybuild/buildtool
MIT License
184 stars 38 forks source link

FileUtility - Checks if destination folder exists, then creates one if it doesn't #6

Closed mallowmew closed 6 years ago

mallowmew commented 6 years ago

Unity would throw an IO exception if I tried to copy my $BUILDPATH to another folder if the destination had a path like: C:/path to my google drive/game builds/$PRODUCT_NAME-$VERSION/$ARCHITECTURE. Builds would work as expected without the nested folder.

Adding a check that the folder exists before trying the copy, and creating it if it doesn't, prevents the exception for me and made the build action work as I expected, so I thought I would share.

Chaser324 commented 6 years ago

Thanks for pointing out the bug and submitting a fix. I made a minor change that prevents every file copy/move from looking like an overwrite - not that it really matters at this point anyway because there isn't currently an overwrite option presented to the user.