Skip to content

Commit

Permalink
Update scripts-testing.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Oct 10, 2024
1 parent 8a275ea commit b7f246f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/scripts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,17 @@ jobs:
- name: "Test scripts on Bash"
shell: bash
run: |
# Testing scripts on Bash...
bash --version | head -n 1
# Testing scripts...
# shellcheck disable=SC2016 # Intended: Expressions don't expand in single quotes
readonly workspace_dir='${{ github.workspace }}'
test_on_all_shells()
{
local _shell _script
_script="${1:?}"
local _shell
for _shell in sh bash dash ksh zsh osh csh tcsh tclsh; do
if ! command 1> /dev/null -v "${_shell:?}"; then continue; fi
printf '\nSHELL: %s - SCRIPT: "%s"\n\n' "${_shell:?}" "${_script:?}"
"${_shell:?}" "${workspace_dir}/${_script}" || echo $?
"${_shell:?}" --version | head -n 1
printf 'SHELL: %s - SCRIPT: "%s"\n\n' "${_shell:?}" "${1:?}"
"${_shell:?}" "${1:?}"
printf '\nRETURN CODE:%s\n' "${?}"
done
}
Expand Down

0 comments on commit b7f246f

Please sign in to comment.