mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Show the real error message instead of "Can not remove temporary directory" when "platform.ini" is broken // Resolve #4480
This commit is contained in:
@ -20,6 +20,7 @@ PlatformIO Core 6
|
|||||||
* Made assets (templates, ``99-platformio-udev.rules``) part of Python's module (`issue #4458 <https://github.com/platformio/platformio-core/issues/4458>`_)
|
* Made assets (templates, ``99-platformio-udev.rules``) part of Python's module (`issue #4458 <https://github.com/platformio/platformio-core/issues/4458>`_)
|
||||||
* Updated `Clang-Tidy <https://docs.platformio.org/en/latest/plus/check-tools/clang-tidy.html>`__ check tool to v15.0.5 with new diagnostics and bugfixes
|
* Updated `Clang-Tidy <https://docs.platformio.org/en/latest/plus/check-tools/clang-tidy.html>`__ check tool to v15.0.5 with new diagnostics and bugfixes
|
||||||
* Removed dependency on the "zeroconf" package and install it only when a user lists mDNS devices (issue with zeroconf's LGPL license)
|
* Removed dependency on the "zeroconf" package and install it only when a user lists mDNS devices (issue with zeroconf's LGPL license)
|
||||||
|
* Show the real error message instead of "Can not remove temporary directory" when "platform.ini" is broken (`issue #4480 <https://github.com/platformio/platformio-core/issues/4480>`_)
|
||||||
|
|
||||||
6.1.5 (2022-11-01)
|
6.1.5 (2022-11-01)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -319,7 +319,13 @@ class ProjectConfigBase:
|
|||||||
if section == "this":
|
if section == "this":
|
||||||
section = parent_section
|
section = parent_section
|
||||||
if option == "__env__":
|
if option == "__env__":
|
||||||
assert parent_section.startswith("env:")
|
if not parent_section.startswith("env:"):
|
||||||
|
raise exception.ProjectOptionValueError(
|
||||||
|
f"`${{this.__env__}}` is called from the `{parent_section}` "
|
||||||
|
"section that is not valid PlatformIO environment, see",
|
||||||
|
option,
|
||||||
|
section,
|
||||||
|
)
|
||||||
return parent_section[4:]
|
return parent_section[4:]
|
||||||
# handle nested calls
|
# handle nested calls
|
||||||
try:
|
try:
|
||||||
|
@ -24,6 +24,7 @@ from tabulate import tabulate
|
|||||||
from platformio import app, exception, fs, util
|
from platformio import app, exception, fs, util
|
||||||
from platformio.device.monitor.command import device_monitor_cmd
|
from platformio.device.monitor.command import device_monitor_cmd
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
|
from platformio.project.exception import ProjectError
|
||||||
from platformio.project.helpers import find_project_dir_above, load_build_metadata
|
from platformio.project.helpers import find_project_dir_above, load_build_metadata
|
||||||
from platformio.run.helpers import clean_build_dir, handle_legacy_libdeps
|
from platformio.run.helpers import clean_build_dir, handle_legacy_libdeps
|
||||||
from platformio.run.processor import EnvironmentProcessor
|
from platformio.run.processor import EnvironmentProcessor
|
||||||
@ -115,6 +116,8 @@ def cli(
|
|||||||
build_dir = config.get("platformio", "build_dir")
|
build_dir = config.get("platformio", "build_dir")
|
||||||
try:
|
try:
|
||||||
clean_build_dir(build_dir, config)
|
clean_build_dir(build_dir, config)
|
||||||
|
except ProjectError as exc:
|
||||||
|
raise exc
|
||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
click.secho(
|
click.secho(
|
||||||
"Can not remove temporary directory `%s`. Please remove "
|
"Can not remove temporary directory `%s`. Please remove "
|
||||||
|
Reference in New Issue
Block a user