public function removeEnvironment($name)
    {
        $removed = false;
        $environments = $this->getEnvironments();
        if (true == in_array($name, $environments)) {
            if (($key = array_search($name, $environments)) !== false) {
                $this->printLn("Removing environment {$name}");
                unset($environments[$key]);
                $removed = true;
            }
        }
        if (false == $removed) {
            $this->printLn("environment {$name} not found or removed");
        }
        $this->setEnvironments($environments);
        return $this;
    }