修复git配置文件被删除的bug

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
2021-09-08 10:01:23 +08:00
parent 2223c96ba2
commit a2651f7fb1

View File

@@ -177,12 +177,24 @@ class SharelibHandler:
finit_cpp.close()
def export(self, share_lib_path):
reserved_subdir = ['.git',
'README.md', '.gitignore', '.gitmodules', '.gitattributes',
'.drone.yml']
dist_path = share_lib_path + '/' + self._lib_name
if os.path.exists(dist_path):
shutil.rmtree(dist_path)
for d in os.listdir(dist_path):
if d in reserved_subdir:
continue
pth = os.path.join(dist_path, d)
if os.path.isfile(pth):
os.remove(pth)
continue
shutil.rmtree(pth)
print("dist_path: " + dist_path)
os.makedirs(dist_path)
for item in self._items:
if item._group == '':