Skip to content

Commit d3a7464

Browse files
gstraussjon-turney
authored andcommitted
Use D: drive as default work-vol
It's measurably faster, so it makes no sense not to use it by default.
1 parent 1c9eb7c commit d3a7464

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Parameters
2222
| ------------------- | -------------------------------------------- | -----------
2323
| platform | x86_64 | Install the x86 or x86\_64 version of Cygwin.
2424
| packages | *none* | List of additional packages to install.
25-
| install-dir | C:\cygwin | Installation directory (overrides work-vol)
25+
| install-dir | D:\cygwin | Installation directory (overrides work-vol)
2626
| site | http://mirrors.kernel.org/sourceware/cygwin/ | Mirror sites to install from, separated by whitespace
2727
| pubkeys | *none* | Absolute paths of extra public key files (RFC4880 format), separated by whitespace
2828
| check-sig | true | Whether to check the setup.ini signature
2929
| add-to-path | true | Whether to add Cygwin's `/bin` directory to the system `PATH`
3030
| allow-test-packages | false | Consider package versions marked test for installation
3131
| check-hash | true | Whether to check the hash of the downloaded Cygwin installer.
32-
| work-vol | C: | Volume on which to store setup and packages, and install Cygwin.
32+
| work-vol | D: | Volume on which to store setup and packages, and install Cygwin.
3333

3434
Line endings
3535
------------

Diff for: action.yml

+19-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ inputs:
1010
description: Packages to install
1111
required: false
1212
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)
1515
description: Installation directory (overrides work-vol)
1616
required: false
1717
default: ''
@@ -40,7 +40,7 @@ inputs:
4040
work-vol:
4141
description: Volume on which to store setup and packages, and install Cygwin
4242
required: false
43-
default: 'C:'
43+
default: ''
4444

4545
runs:
4646
using: "composite"
@@ -55,7 +55,17 @@ runs:
5555
echo "unknown platform $platform"
5656
exit 1
5757
}
58+
5859
$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+
5969
$setupExe = "$vol\setup.exe"
6070
$setupFileName = "setup-$platform.exe"
6171
Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile $setupExe
@@ -146,6 +156,12 @@ runs:
146156
# PowerShell wait for it to exit
147157
& $setupExe $args | Out-Default
148158
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+
149165
if ('${{ inputs.add-to-path }}' -eq 'true') {
150166
echo "$installDir\bin" >> $env:GITHUB_PATH
151167
}

0 commit comments

Comments
 (0)