Fix a broken support for custom configuration file for pio debug command // Resolve #3922

This commit is contained in:
Ivan Kravets
2021-04-11 22:21:01 +03:00
parent eecc825c90
commit b35c5a22bb
4 changed files with 7 additions and 7 deletions

View File

@ -82,9 +82,10 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface, __unpro
if "platform" not in env_options:
raise ProjectEnvsNotAvailableError()
debug_config = DebugConfigFactory.new(
init_platform(env_options["platform"]), project_config, env_name
)
with fs.cd(project_dir):
debug_config = DebugConfigFactory.new(
init_platform(env_options["platform"]), project_config, env_name
)
if "--version" in __unprocessed:
return subprocess.run(

View File

@ -146,9 +146,7 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
)
def _load_build_data(self):
data = load_project_ide_data(
os.path.dirname(self.project_config.path), self.env_name, cache=True
)
data = load_project_ide_data(os.getcwd(), self.env_name, cache=True)
if data:
return data
raise DebugInvalidOptionsError("Could not load a build configuration")

View File

@ -105,6 +105,7 @@ def predebug_project(
ctx.invoke(
cmd_run,
project_dir=project_dir,
project_conf=project_config.path,
environment=[env_name],
target=["__debug"] + (["upload"] if preload else []),
verbose=verbose,

View File

@ -384,7 +384,7 @@ class ProjectConfigDirsMixin(object):
if result is None:
return None
project_dir = os.path.dirname(self.path)
project_dir = os.getcwd()
# patterns
if "$PROJECT_HASH" in result: