Use function that substitutes environment variables and checks for
directory presence.