Updated to check for the existence of the public directory before trying to copy over assets.