Index: Project.php =================================================================== --- Project.php (revision 16020) +++ Project.php (working copy) @@ -56,22 +56,24 @@ } $profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path); - - if ($profile !== false) { - require_once 'Zend/Tool/Framework/Client/Exception.php'; - throw new Zend_Tool_Framework_Client_Exception('A project already exists here'); - } - - $newProfile = new Zend_Tool_Project_Profile(array( - 'projectDirectory' => $path, - 'profileData' => $this->_getDefaultProfile() + + if (!$this->_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path)) { + $newProfile = new Zend_Tool_Project_Profile(array( + 'projectDirectory' => $path, + 'profileData' => $this->_getDefaultProfile() )); - - $newProfile->loadFromData(); + $newProfile->loadFromData(); + + $this->_loadedProfile = $newProfile; + } $this->_registry->getResponse()->appendContent('Creating project at ' . $path); - foreach ($newProfile->getIterator() as $resource) { + foreach ($this->_loadedProfile->getIterator() as $resource) { + if ($resource->exists()) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; + throw new Zend_Tool_Framework_Client_Exception('A ' . $resource->getName() . ' already exists here. Project seems to exists already'); + } $resource->create(); } }