Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ runs:
JULIA_PKG_SERVER: ""
- run: |
# The Julia command that will be executed
julia_cmd=( julia --color=yes --depwarn=${{ inputs.depwarn }} --inline=${{ inputs.inline }} --project=${{ inputs.project }} -e 'import Pkg;include(joinpath(ENV["GITHUB_ACTION_PATH"], "kwargs.jl"));kwargs = Kwargs.kwargs(;coverage = :(${{ inputs.coverage }}),force_latest_compatible_version = :(${{ inputs.force_latest_compatible_version }}), julia_args = ["--check-bounds=${{ inputs.check_bounds }}"]);Pkg.test(; kwargs...)' )
julia_cmd="julia --color=yes --depwarn=${{ inputs.depwarn }} --inline=${{ inputs.inline }} --project=${{ inputs.project }} -e 'import Pkg;include(joinpath(ENV[\"GITHUB_ACTION_PATH\"], \"kwargs.jl\"));kwargs = Kwargs.kwargs(;coverage = :(${{ inputs.coverage }}),force_latest_compatible_version = :(${{ inputs.force_latest_compatible_version }}), julia_args = [\"--check-bounds=${{ inputs.check_bounds }}\"]);Pkg.test(; kwargs...)'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot about this for so long.

My understanding of bash is that for commands like this, parantheses should be used. The if/then block below deals with the main issue we ran into before when using double quotes but there might be other unintentional consequences I'm not aware of. So I'd prefer to stick to the best practice that was recommended back then rather switching to double quotes.

The second suggestion in #41 seems like it should work without going back to double quotes.


# Add the prefix in front of the command if there is one
prefix="${{ inputs.prefix }}"
[[ -n $prefix ]] && julia_cmd=( "$prefix" "${julia_cmd[@]}" )

# Run the Julia command
"${julia_cmd[@]}"
if [[ -n $prefix ]]
then
cmd="$prefix $julia_cmd"
eval $cmd
else
cmd="$julia_cmd"
eval $cmd
fi
shell: bash