Mulesoft Groovy 脚本权限在读取脚本文件时被拒绝

Mulesoft Groovy script permission denied when reading a script file

我在 Anypoint studio 中创建了一个流程。 我想执行我保存的 shell 脚本。我正在使用带有 Groovy 的执行脚本组件。我的 Groovy 代码如下所示:

cmd = '${mule.home}'
"$cmd/apps/script_test/script.sh".execute().text

我已经确认该文件在那里,但是每当我 运行 这个:

时,我总是收到访问被拒绝的错误
 java.io.IOException: Cannot run program "/Applications/AnypointStudio.app/Contents/Eclipse/plugins/org.mule.tooling.server.4.3.0.ee_7.3.5.202104131253/mule/apps/script_test/script.sh": error=13, Permission denied

我已经尝试更改文件的权限,甚至将其设置为 777,但我仍然收到此错误。我有什么想法可以让这个达到 运行?

您必须 运行 .sh 使用 shbash 或其他一些 shell.

这应该有效

"sh .../script.sh".execute().text