mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Look for project dir in sys env variables (hooks for Eclipse, CLion)
This commit is contained in:
@ -53,8 +53,12 @@ from platformio.project.helpers import (is_platformio_project,
|
|||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, project_dir, project_conf, environment, verbose, interface,
|
def cli(ctx, project_dir, project_conf, environment, verbose, interface,
|
||||||
__unprocessed):
|
__unprocessed):
|
||||||
if not is_platformio_project(project_dir) and os.getenv("CWD"):
|
# use env variables from Eclipse or CLion
|
||||||
project_dir = os.getenv("CWD")
|
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):
|
with util.cd(project_dir):
|
||||||
config = ProjectConfig.get_instance(
|
config = ProjectConfig.get_instance(
|
||||||
|
Reference in New Issue
Block a user