Copy php application even if directory exists but is empty

parent 14a83ba7
......@@ -40,10 +40,14 @@ class Recipe(GenericBaseRecipe):
def install(self):
path_list = []
# Copy application
if not os.path.exists(self.options['htdocs']):
shutil.copytree(self.options['source'],
self.options['htdocs'])
# Copy application if not already existing
htdocs_location = self.options['htdocs']
if not (os.path.exists(htdocs_location) and os.listdir(htdocs_location)):
try:
os.rmdir(htdocs_location)
except:
pass
shutil.copytree(self.options['source'], htdocs_location)
# Install php.ini
php_ini = self.createFile(os.path.join(self.options['php-ini-dir'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment