mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-02 01:38:00 +00:00
parent
7cef444601
commit
b4407f79ce
@ -16,12 +16,15 @@ def erase_directory(dir: str):
|
||||
os.remove(directory)
|
||||
|
||||
def clear_directory(dir: str):
|
||||
for files in os.listdir(dir):
|
||||
path = os.path.join(dir, files)
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except OSError:
|
||||
os.remove(path)
|
||||
if os.path.exists(dir):
|
||||
for files in os.listdir(dir):
|
||||
path = os.path.join(dir, files)
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except OSError:
|
||||
os.remove(path)
|
||||
else:
|
||||
log("Trying to clear directory but it doesn't exist: " + dir)
|
||||
|
||||
def copy_directory(src: str, dst: str):
|
||||
if os.path.isdir(src) and os.path.isdir(dst):
|
||||
|
Loading…
x
Reference in New Issue
Block a user