summaryrefslogtreecommitdiff
path: root/bin/ansible-galaxy
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ansible-galaxy')
-rwxr-xr-xbin/ansible-galaxy11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy
index 6118efee..288318aa 100755
--- a/bin/ansible-galaxy
+++ b/bin/ansible-galaxy
@@ -1054,6 +1054,15 @@ class GalaxyCLI(CLI):
"however it will reset any main.yml files that may have\n"
"been modified there already." % to_native(obj_path))
+ # delete the contents rather than the collection root in case init was run from the root (--init-path ../../)
+ for root, dirs, files in os.walk(b_obj_path, topdown=True):
+ for old_dir in dirs:
+ path = os.path.join(root, old_dir)
+ shutil.rmtree(path)
+ for old_file in files:
+ path = os.path.join(root, old_file)
+ os.unlink(path)
+
if obj_skeleton is not None:
own_skeleton = False
else:
@@ -1506,6 +1515,8 @@ class GalaxyCLI(CLI):
:param artifacts_manager: Artifacts manager.
"""
+ if artifacts_manager is not None:
+ artifacts_manager.require_build_metadata = False
output_format = context.CLIARGS['output_format']
collections_search_paths = set(context.CLIARGS['collections_path'])