Skip to content

Commit 332d0b8

Browse files
committed
[build] update cdp script to generate pdls if the directory is empty
need to be able to manually update pdl files and use this script to propagate them, but reverting files does not delete the directory so need to check for empty as well
1 parent b435a5d commit 332d0b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/update_cdp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def add_pdls(chrome_milestone):
6767
if os.path.isdir(old_dir):
6868
shutil.rmtree(old_dir)
6969

70-
if not os.path.isdir(target_dir):
70+
if not target_dir.is_dir() or not any(target_dir.iterdir()):
7171
os.makedirs(target_dir, exist_ok=True)
7272
if os.path.isdir(source_dir):
7373
shutil.copytree(source_dir, target_dir, dirs_exist_ok=True)

0 commit comments

Comments
 (0)