Adding extra_scripts breaks project configuration

Hi,

For some reason adding extra_script into my platformio.ini file causes project configuration to never end. The popup keeps showing that configuration is in progess. Below are my platformio.ini file & the screenshot for the popup.

platformio.ini:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; Redirecting...

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
monitor_speed = 115200
monitor_raw = yes
test_framework = unity
lib_deps =
arkhipenko/TaskScheduler@^3.7.0
me-no-dev/ESPAsyncTCP@^1.2.2
me-no-dev/ESP Async WebServer@^1.2.3
build_flags = -I include
; -D _TASK_TIMECRITICAL
; -D _TASK_SLEEP_ON_IDLE_RUN
-D _TASK_STATUS_REQUEST
; -D _TASK_WDT_IDS
; -D _TASK_LTS_POINTER
; -D _TASK_PRIORITY
; -D _TASK_MICRO_RES
; -D _TASK_STD_FUNCTION
; -D _TASK_DEBUG
; -D _TASK_INLINE
; -D _TASK_TIMEOUT
; -D _TASK_OO_CALLBACKS
; -D _TASK_EXPOSE_CHAIN
; -D _TASK_SCHEDULING_OPTIONS
; -D _TASK_DEFINE_MILLIS
; -D _TASK_EXTERNAL_TIME
; -D TEST
extra_scripts =
pre:build.py

So what is the content of that script?

Here it is:

Import(“env”)

print("Building for release/production (yes): ")

input_env = input()

env.Append(BUILD_FLAGS=[“-D PROD” if input_env in [“yes”, “y”] else “-D DEV”])

Ok I found the issue. I missed the below statements which are supposed to be added when reading input as per [Asking for input (prompts) — PlatformIO latest documentation](Asking for input).

if env.IsIntegrationDump():
# stop the current script execution
Return()

It works now. Thanks!