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: if "platform" not in env_options:
raise ProjectEnvsNotAvailableError() raise ProjectEnvsNotAvailableError()
debug_config = DebugConfigFactory.new( with fs.cd(project_dir):
init_platform(env_options["platform"]), project_config, env_name debug_config = DebugConfigFactory.new(
) init_platform(env_options["platform"]), project_config, env_name
)
if "--version" in __unprocessed: if "--version" in __unprocessed:
return subprocess.run( return subprocess.run(

View File

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

View File

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

View File

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