Edited the `detectEnvironment` function to check for environment variables