Fixed an issue when `env.BoardConfig()` does not work for custom boards in extra scripts of libraries // Resolve #3264

This commit is contained in:
Ivan Kravets
2019-11-12 13:41:39 +02:00
parent cbb7869da1
commit c6a8e03367
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ PlatformIO Core 4.0
* Handle project configuration (monitor, test, and upload options) for PIO Remote commands (`issue #2591 <https://github.com/platformio/platformio-core/issues/2591>`_)
* Fixed an issue with the broken latest news for PIO Home
* Fixed an issue when ``env.BoardConfig()`` does not work for custom boards in extra scripts of libraries (`issue #3264 <https://github.com/platformio/platformio-core/issues/3264>`_)
4.1.0 (2019-11-07)
~~~~~~~~~~~~~~~~~~

View File

@ -44,7 +44,8 @@ def BoardConfig(env, board=None):
try:
board = board or env.get("BOARD")
assert board, "BoardConfig: Board is not defined"
config = p.board_config(board)
with fs.cd(env.subst("$PROJECT_DIR")):
config = p.board_config(board)
except (AssertionError, exception.UnknownBoard) as e:
sys.stderr.write("Error: %s\n" % str(e))
env.Exit(1)