Look for project dir in sys env variables (hooks for Eclipse, CLion)

This commit is contained in:
Ivan Kravets
2019-06-27 14:57:05 +03:00
parent 1d80914070
commit e27b40390d

View File

@ -53,8 +53,12 @@ from platformio.project.helpers import (is_platformio_project,
@click.pass_context
def cli(ctx, project_dir, project_conf, environment, verbose, interface,
__unprocessed):
if not is_platformio_project(project_dir) and os.getenv("CWD"):
project_dir = os.getenv("CWD")
# use env variables from Eclipse or CLion
for sysenv in ("CWD", "PWD", "PLATFORMIO_PROJECT_DIR"):
if is_platformio_project(project_dir):
break
if os.getenv(sysenv):
project_dir = os.getenv(sysenv)
with util.cd(project_dir):
config = ProjectConfig.get_instance(