fill_config.py: copy subdirs

Change-Id: I010336d1ab2bb8abb69f38b3b5630ec9c47c77ed
This commit is contained in:
Oliver Smith 2019-11-08 12:28:15 +01:00 committed by Neels Hofmeyr
parent 1d6a2b3bc3
commit 87dae195e3
1 changed files with 7 additions and 0 deletions

View File

@ -224,6 +224,13 @@ for tmpl_name in sorted(os.listdir(tmpl_dir)):
tmpl_src = os.path.join(tmpl_dir, tmpl_name)
dst = tmpl_name
# subdirectories: must not contain config files, just copy them
if os.path.isdir(tmpl_src):
if os.path.exists(dst) and os.path.isdir(dst):
shutil.rmtree(dst)
shutil.copytree(tmpl_src, dst)
continue
if args.check_stale:
check_stale(local_config_file, dst)
check_stale(tmpl_src, dst)