Clean deploy

Do not merge. Pending regression tests.
Well it makes more sense when you read the code.
For new apps the directory has not been created yet. So it would do nothing.