@@ -10,8 +10,8 @@ inputs:
10
10
description : Packages to install
11
11
required : false
12
12
install-dir :
13
- # by default , install to C :\cygwin rather than the platform dependent
14
- # default to make everything simpler
13
+ # For consistency and simplicity , install to <work-dir> :\cygwin rather
14
+ # than to the platform dependent default (e.g. <work-dir>:\cygwin64)
15
15
description : Installation directory (overrides work-vol)
16
16
required : false
17
17
default : ' '
@@ -40,7 +40,7 @@ inputs:
40
40
work-vol :
41
41
description : Volume on which to store setup and packages, and install Cygwin
42
42
required : false
43
- default : ' C: '
43
+ default : ' '
44
44
45
45
runs :
46
46
using : " composite"
55
55
echo "unknown platform $platform"
56
56
exit 1
57
57
}
58
+
58
59
$vol = '${{ inputs.work-vol }}'
60
+ # If temporary drive D: doesn't exist in the VM, fallback to C:
61
+ if ("$vol" -eq '') {
62
+ if (Test-Path -LiteralPath 'D:\') {
63
+ $vol = 'D:'
64
+ } else {
65
+ $vol = 'C:'
66
+ }
67
+ }
68
+
59
69
$setupExe = "$vol\setup.exe"
60
70
$setupFileName = "setup-$platform.exe"
61
71
Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile $setupExe
@@ -146,6 +156,12 @@ runs:
146
156
# PowerShell wait for it to exit
147
157
& $setupExe $args | Out-Default
148
158
159
+ if ('${{ inputs.work-vol }}' -eq '' -and '${{ inputs.install-dir }}' -eq '') {
160
+ # Create a symlink for compatibility with previous versions of this
161
+ # action, just in case something relies upon C:\cygwin existing
162
+ cmd /c mklink /d C:\cygwin $installDir
163
+ }
164
+
149
165
if ('${{ inputs.add-to-path }}' -eq 'true') {
150
166
echo "$installDir\bin" >> $env:GITHUB_PATH
151
167
}
0 commit comments