Dotfiles not run in bash?

CS telling me my function is invalid when executing my dotfiles “Syntax error: “(” unexpected”.
I have a valid bash function defined but I think the issue is the script is not being run in bash. I added a shebang to but it still resulted in the error.

I changed the function to a shell compliant function (i.e. removed the word function) and now it runs successfully.

Not sure if this is expected so thought I would post to share my findings.

Thanks for reporting! This looks like a bug. We recently switched most commands to execute in sh instead of bash so that we can run on more containers successfully in the future, including those without bash installed such as some slim alpine images. But there’s a bug where we are sourcing the dotfiles instead of executing them, which prevents the shebang from working and forces the scripts to execute in sh.