mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-02 11:24:27 +02:00
Fix bug with deleting ".pioenvs" when it doesn't exist
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from os.path import getmtime, join
|
from os.path import getmtime, isdir, join
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@@ -28,9 +28,11 @@ def cli(ctx, environment, target, upload_port):
|
|||||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||||
|
|
||||||
# remove ".pioenvs" if project config is modified
|
# remove ".pioenvs" if project config is modified
|
||||||
if (getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
_pioenvs_dir = util.get_pioenvs_dir()
|
||||||
getmtime(util.get_pioenvs_dir())):
|
if (isdir(_pioenvs_dir) and
|
||||||
rmtree(util.get_pioenvs_dir())
|
getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
||||||
|
getmtime(_pioenvs_dir)):
|
||||||
|
rmtree(_pioenvs_dir)
|
||||||
|
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
# skip main configuration section
|
# skip main configuration section
|
||||||
|
Reference in New Issue
Block a user