Skip to content
Open
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
18 changes: 18 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ inputs:
description: Volume on which to store setup and packages, and install Cygwin
required: false
default: ''
login-shell:
description: Use a login shell when using wrapper script
required: false
default: 'true'

outputs:
setup:
Expand Down Expand Up @@ -224,6 +228,20 @@ runs:
echo "$installDir\bin" >> $env:GITHUB_PATH
}

# add a wrapper script to put on path, since a run step's shell doesn't accept output variable substitutions
$wrapperDir = Join-Path $env:RUNNER_TEMP ([IO.Path]::GetRandomFileName())
New-Item -Path $wrapperDir -ItemType Directory -Force | Out-Null
$loginshell = ""
if ('${{ inputs.login-shell }}' -eq $true) {
$loginshell = "l"
}
Set-Content -Path (Join-Path $wrapperDir "cygwin.cmd") -Value @"
@echo off`r
set CHERE_INVOKING=1`r
$installDir\\bin\\bash.exe -o igncr -${loginshell}eo pipefail %*
"@
echo "$wrapperDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

# run login shell to copy skeleton profile files
& "$installDir\bin\bash.exe" --login

Expand Down