Delete project directory if project creation doesn't succeed

If createDirectory() fails, then the catch block will try to deleteDir() it. Is this intended?

Also, I think the code which cannot fail, which is all the code up to this line should be outside the try block.