Running script before applying an OTA update

Actually, I want to apply a User Confirmation use case for my project. I tried the directory update as shown in State scripting for Raspberry PI board running ubuntu 18.04 and How to create state scripts with Mender using Raspberry Pi. Deployment would be successful but, the script wouldn’t run.

Is there specific way or location to save the script ?
The -s prefix wouldn’t run with directory-artifact-gen and I tried it by modifying the code from https://github.com/mendersoftware/mender/blob/master/support/modules-artifact-gen/directory-artifact-gen

image

by adding -s ~/Downloads/ArtifactInstall_Enter_01_User_Confirmation-v2.py , but that didn’t work too.