add directory check

prevents composer from failing chef run by making sure target directory either does not exist or is empty.