Skip to content

Commit 650fbf9

Browse files
authored
Merge pull request #3 from vChavezB/dsutil_replace
Dsutil replace for shutil due to deprecation warning
2 parents 94b1ca4 + 36c88c3 commit 650fbf9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

puncover_html.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import os
77
import argparse
8-
import distutils.dir_util
8+
import shutil
99

1010
version = "1.1.0"
1111

@@ -190,17 +190,17 @@ def get_local_html(puncover_url):
190190

191191
def local_html():
192192
print("Processing main page")
193-
pages_dir = dir_out.joinpath("path")
194-
static_dir = dir_out.joinpath("static")
193+
static_dir_in = script_root.joinpath("static")
194+
pages_dir_out = dir_out.joinpath("path")
195+
static_dir_out = dir_out.joinpath("static")
195196
if not os.path.exists(dir_out):
196197
os.makedirs(dir_out)
197-
if not os.path.exists(pages_dir):
198-
os.makedirs(pages_dir)
199-
if not os.path.exists(static_dir):
200-
os.makedirs(static_dir)
201-
# Copy html static dir (css,js,etc) to output
202-
distutils.dir_util.copy_tree(str(script_root.joinpath("static")),
203-
str(static_dir))
198+
if not os.path.exists(pages_dir_out):
199+
os.makedirs(pages_dir_out)
200+
if os.path.exists(static_dir_out):
201+
shutil.rmtree(static_dir_out)
202+
# Copy html static dir (css,js,etc) to output
203+
shutil.copytree(static_dir_in, static_dir_out)
204204
index = requests.get(url_base)
205205
index_html_path = dir_out.joinpath("index.html")
206206
index_file = open(index_html_path, "w+")

0 commit comments

Comments
 (0)