mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Raise exception when try to load non-PIO project
This commit is contained in:
@ -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"
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user