Override default “platformio.ini” with a custom using "-c, --project-conf" option // Resolve #1913

This commit is contained in:
Ivan Kravets committed 2019-05-10 00:01:10 +03:00
1 parent 2b5ac57fd0
commit c79b3ff7f1
7 files changed
+37 -25

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
file_okay=False, dir_okay=True, writable=True, resolve_path=True))
@click.option("--keep-build-dir", is_flag=True)
@click.option(
"-C",
"-c",
"--project-conf",
type=click.Path(
exists=True,
+12 -3
View File
@@ -47,12 +47,21 @@ from platformio.project.helpers import (
dir_okay=True,
writable=True,
resolve_path=True))
@click.option(
"-c",
"--project-conf",
type=click.Path(
exists=True,
file_okay=True,
dir_okay=False,
readable=True,
resolve_path=True))
@click.option("-s", "--silent", is_flag=True)
@click.option("-v", "--verbose", is_flag=True)
@click.option("--disable-auto-clean", is_flag=True)
@click.pass_context
def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
disable_auto_clean):
def cli(ctx, environment, target, upload_port, project_dir, project_conf,
silent, verbose, disable_auto_clean):
# find project directory on upper level
if isfile(project_dir):
project_dir = find_project_dir_above(project_dir)
@@ -70,7 +79,7 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
fg="yellow")
config = ProjectConfig.get_instance(
join(project_dir, "platformio.ini"))
project_conf or join(project_dir, "platformio.ini"))
config.validate()
results = []
+1 -1
View File
@@ -27,7 +27,7 @@ CORE_PACKAGES = {
"contrib-piohome": "^2.0.1",
"contrib-pysite":
"~2.%d%d.190418" % (sys.version_info[0], sys.version_info[1]),
"tool-pioplus": "^2.1.5",
"tool-pioplus": "^2.2.0",
"tool-unity": "~1.20403.0",
"tool-scons": "~2.20501.7" if util.PY2 else "~3.30005.0"
}