remove distutils in favor of shutil

This commit is contained in:
Nick Sweeting 2019-03-27 11:39:51 -04:00
parent e1a1ea25dd
commit 002206d4fe
2 changed files with 9 additions and 7 deletions

View file

@ -2,6 +2,7 @@ import os
import re
import sys
import time
import shutil
from json import JSONEncoder
from typing import List, Optional, Any
@ -604,6 +605,12 @@ def chmod_file(path: str, cwd: str='.', permissions: str=OUTPUT_PERMISSIONS, tim
raise Exception('Failed to chmod {}/{}'.format(cwd, path))
@enforce_types
def copy_and_overwrite(from_path: str, to_path: str):
if os.path.exists(to_path):
shutil.rmtree(to_path)
shutil.copytree(from_path, to_path)
@enforce_types
def chrome_args(**options) -> List[str]:
"""helper to build up a chrome shell command with arguments"""