Conversation
The "Check execute permission of bash scripts" step required every *.sh file to be executable, which now conflicts with the previous commit removing the executable bit from doc/ and test/ scripts. Adapt it to require execute permission everywhere else, and to require the *absence* of it under doc/ and test/. Related to #9048
|
I don't think these scripts need executable permissions. They can be run via |
Per feedback from @seisman on PR #9133: every *.sh script in the repo is run through 'bash', not directly, so none of them need execute permission except share/tools/gmt_functions.sh, which is meant to be sourced. This covers scripts under admin/, ci/, share/tools/, and src/ that were left untouched in the previous commit. Simplify the code-validator.yml check accordingly, back to a single rule. Assisted-by: Claude Sonnet 5 (High effort)
|
|
|
Fixed now. No more exceptions, no *.sh should be executable. |
|
The Tests workflow fails and needs to be fixed. it can be done in a separate PR because this PR already contains too many changed files. |
They are failing because of this PR, right? |
|
I think we need to update Line 309 in 6312737 to |
|
It sounds fine. I will do make another PR for this. |
…9135) Test scripts are sourced (". ${local_script}"), not executed, so the existing "if ! [ -x "${script}" ]" guard was checking the wrong bit. It started failing every test once #9133 removed the unnecessary executable permission from *.sh scripts. Relax the guard to check readability instead. Note: switching the sourcing itself (". ${local_script}") to "bash ${local_script}" was also proposed, but that would run the test script in a subshell instead of gmtest.sh's own shell, breaking the "ps=" variable classic-mode scripts set for later baseline comparison (it wouldn't propagate back). Sourcing is kept as-is since it never required execute permission in the first place. Related to #9048, #9133 Assisted-by: Claude Sonnet 5 (High effort)
|
I don’t understand why is needed this to change all these files. If the solution is to call them prefixed with bash it doesn’t matter if they have the executable mode or not. |
|
As I understand it, scripts created under Windows do not have executable permissions by default. Consequently, we may encounter inconsistent executable permissions across our scripts in the future. |
Assisted-by: Claude Sonnet 5 (High effort)
Removed the executable permission from example and test
.shscripts underdoc/andtest/.Updated the
code-validator.ymlCI checker to reflect this new policy.Closes #9048