From 18b10a7fbf56d10f78e7588923a7ceb3a61b72ca Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 3 Dec 2017 02:15:49 +0200 Subject: [PATCH] Raise exception when try to load non-PIO project --- platformio/managers/core.py | 2 +- platformio/util.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index dcf85bd1..bf869f72 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.3.2,<2", "pysite-pioplus": ">=0.4.2,<2", - "tool-pioplus": ">=0.10.13,<2", + "tool-pioplus": ">=0.11.0,<2", "tool-unity": "~1.20302.1", "tool-scons": "~3.20501.2" } diff --git a/platformio/util.py b/platformio/util.py index b3456444..129d3752 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -331,11 +331,10 @@ def get_projectdata_dir(): def load_project_config(path=None): if not path or isdir(path): - project_dir = path or get_project_dir() - if not is_platformio_project(project_dir): - raise exception.NotPlatformIOProject(project_dir) - path = join(project_dir, "platformio.ini") - assert isfile(path) + path = join(path or get_project_dir(), "platformio.ini") + if not isfile(path): + raise exception.NotPlatformIOProject( + dirname(path) if path.endswith("platformio.ini") else path) cp = ProjectConfig() cp.read(path) return cp