feat: don't copy static hidden files
This commit is contained in:
parent
9e2ee75927
commit
0b7bfddd64
0
dist/example_page_2/de/index.html
vendored
0
dist/example_page_2/de/index.html
vendored
1
src/static/.hidden/dont_copy
Normal file
1
src/static/.hidden/dont_copy
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
21551
src/static/bulma.css
vendored
Normal file
21551
src/static/bulma.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
src/static/bulma.min.css
vendored
Normal file
3
src/static/bulma.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -22,13 +22,19 @@ def copy_static():
|
|||||||
os.makedirs(dst, exist_ok=True)
|
os.makedirs(dst, exist_ok=True)
|
||||||
|
|
||||||
for root, dirs, files in os.walk(src):
|
for root, dirs, files in os.walk(src):
|
||||||
|
if any(p.startswith(".") for p in Path(root).parts):
|
||||||
|
continue
|
||||||
|
|
||||||
# Compute relative path from the source root
|
# Compute relative path from the source root
|
||||||
rel_path = os.path.relpath(root, src)
|
rel_path = os.path.relpath(root, src)
|
||||||
dest_dir = os.path.join(dst, rel_path)
|
dest_dir = os.path.join(dst, rel_path)
|
||||||
|
|
||||||
os.makedirs(dest_dir, exist_ok=True)
|
os.makedirs(dest_dir, exist_ok=True)
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
|
if file.startswith("."):
|
||||||
|
continue
|
||||||
|
|
||||||
src_file = os.path.join(root, file)
|
src_file = os.path.join(root, file)
|
||||||
dest_file = os.path.join(dest_dir, file)
|
dest_file = os.path.join(dest_dir, file)
|
||||||
shutil.copy2(src_file, dest_file)
|
shutil.copy2(src_file, dest_file)
|
||||||
@ -38,4 +44,4 @@ def copy_static():
|
|||||||
|
|
||||||
def build():
|
def build():
|
||||||
logger.info("building static page")
|
logger.info("building static page")
|
||||||
copy_static()
|
copy_static()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user