Skip to content

Commit

Permalink
make the shell configurable (default to bash)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Oct 27, 2021
1 parent a932405 commit 4e3a8ef
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,28 @@ inputs:
working-directory:
description: "working directory"
required: false
shell:
description: "shell (options: 'bash' or 'msys2 {0}')"
default: "bash"
required: false

runs:
using: "composite"
steps:
- shell: bash
- name: create bash-or-msys2
shell: bash
run: |
if [[ "${{ inputs.shell }}" == "msys2 {0}" ]]; then
if [[ ! -f "D:/a/_temp/setup-msys2/bash-or-msys2.cmd" ]]; then
powershell New-Item -ItemType SymbolicLink -Path "D:/a/_temp/setup-msys2/bash-or-msys2.cmd" -Target "D:/a/_temp/setup-msys2/msys2.cmd"
fi
elif [[ "${{ inputs.shell }}" == "bash" ]]; then
sudo ln -sf $(which bash) /usr/local/bin/bash-or-msys2
else
echo "unknown shell: ${{ inputs.shell }}"
exit 1
fi
- shell: bash-or-msys2 {0}
working-directory: ${{ inputs.working-directory }}
run: |
status=0
Expand Down

0 comments on commit 4e3a8ef

Please sign in to comment.