chore: more generic shell execution

Change the way the current working directory (CWD) is selected for the shell
execution.