forked from platformio/platformio-core
Check CI SRC paths passed via system environment variable
This commit is contained in:
@ -33,7 +33,7 @@ except ImportError:
|
|||||||
from ConfigParser import ConfigParser
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
|
|
||||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
def validate_path(ctx, param, value): # pylint: disable=unused-argument
|
||||||
invalid_path = None
|
invalid_path = None
|
||||||
value = list(value)
|
value = list(value)
|
||||||
for i, p in enumerate(value):
|
for i, p in enumerate(value):
|
||||||
@ -87,8 +87,8 @@ def cli(ctx, # pylint: disable=R0913
|
|||||||
project_conf,
|
project_conf,
|
||||||
verbose):
|
verbose):
|
||||||
|
|
||||||
if not src:
|
if not src and getenv("PLATFORMIO_CI_SRC"):
|
||||||
src = getenv("PLATFORMIO_CI_SRC", "").split(":")
|
src = validate_path(ctx, None, getenv("PLATFORMIO_CI_SRC").split(":"))
|
||||||
if not src:
|
if not src:
|
||||||
raise click.BadParameter("Missing argument 'src'")
|
raise click.BadParameter("Missing argument 'src'")
|
||||||
|
|
||||||
|
@ -259,9 +259,7 @@ def is_ci():
|
|||||||
def exec_command(*args, **kwargs):
|
def exec_command(*args, **kwargs):
|
||||||
result = {"out": None, "err": None, "returncode": None}
|
result = {"out": None, "err": None, "returncode": None}
|
||||||
|
|
||||||
default = dict(
|
default = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.PIPE)
|
|
||||||
default.update(kwargs)
|
default.update(kwargs)
|
||||||
kwargs = default
|
kwargs = default
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user