Implement custom "rmtree"; resolve issue with Windows and .git

This commit is contained in:
Ivan Kravets
2016-08-05 18:43:20 +03:00
parent c64354ebcc
commit db267513ca
6 changed files with 29 additions and 24 deletions

View File

@@ -16,7 +16,6 @@ from datetime import datetime
from hashlib import sha1
from os import getcwd, makedirs, walk
from os.path import getmtime, isdir, isfile, join
from shutil import rmtree
from time import time
import click
@@ -234,14 +233,14 @@ def _clean_pioenvs_dir(pioenvs_dir):
if (isdir(pioenvs_dir) and
getmtime(join(util.get_project_dir(), "platformio.ini")) >
getmtime(pioenvs_dir)):
rmtree(pioenvs_dir)
util.rmtree_(pioenvs_dir)
# check project structure
if isdir(pioenvs_dir) and isfile(structhash_file):
with open(structhash_file) as f:
if f.read() == proj_hash:
return
rmtree(pioenvs_dir)
util.rmtree_(pioenvs_dir)
if not isdir(pioenvs_dir):
makedirs(pioenvs_dir)