Sets the environment based on folder structure