Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 4cd1e34

Browse files
committed
Update readme and correctly add path
1 parent 4861e20 commit 4cd1e34

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121

122122
## Version Support
123123

124-
**GHC:**
124+
**GHC on Mac/Ubuntu:**
125125

126126
- `latest` (default, recommended)
127127
- `8.10.1` `8.10`
@@ -141,6 +141,15 @@ jobs:
141141
- `8.0.2` `8.0`
142142
- `7.10.3` `7.10`
143143

144+
**GHC on Windows:**
145+
146+
- `latest` (default, recommended)
147+
- `8.10.2.2`
148+
- `8.10.1.1`
149+
- `8.8.4.1`
150+
- `8.8.3.2`
151+
- `8.8.2.1`
152+
144153
Suggestion: Try to support the three latest major versions of GHC.
145154

146155
**Cabal:**

dist/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4291,7 +4291,7 @@ function escapeProperty(s) {
42914291
/***/ 447:
42924292
/***/ (function(module) {
42934293

4294-
module.exports = {"ghc":["8.10.2","8.10.2.2","8.10.1.1","8.10.1","8.8.4.1","8.8.4","8.8.3.2","8.8.3","8.8.2.1","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.3.1","2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
4294+
module.exports = {"ghc":["8.10.2","8.10.2.2","8.10.1","8.10.1.1","8.8.4","8.8.4.1","8.8.3","8.8.3.2","8.8.2","8.8.2.1","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.3.1","2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]};
42954295

42964296
/***/ }),
42974297

@@ -11184,7 +11184,12 @@ async function choco(tool, version) {
1118411184
ignoreReturnCode: true
1118511185
});
1118611186
// Manually add the path because it won't happen until the end of the step normally
11187-
const chocoPath = path_1.join(`${process.env.ChocolateyInstall}`, 'lib', `${tool}.${version}`, 'tools', `${tool}-${version}`, tool === 'ghc' ? 'bin' : '');
11187+
let pathArray = version.split('.');
11188+
let pathVersion = pathArray.length > 3
11189+
? pathArray.slice(0, pathArray.length - 1).join('.')
11190+
: pathArray.join('.');
11191+
const chocoPath = path_1.join(`${process.env.ChocolateyInstall}`, 'lib', `${tool}.${version}`, 'tools', tool === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here
11192+
tool === 'ghc' ? 'bin' : '');
1118811193
core.addPath(chocoPath);
1118911194
}
1119011195
async function ghcupBin(os) {

src/installer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,17 @@ async function choco(tool: Tool, version: string): Promise<void> {
187187
}
188188
);
189189
// Manually add the path because it won't happen until the end of the step normally
190+
const pathArray = version.split('.');
191+
const pathVersion =
192+
pathArray.length > 3
193+
? pathArray.slice(0, pathArray.length - 1).join('.')
194+
: pathArray.join('.');
190195
const chocoPath = join(
191196
`${process.env.ChocolateyInstall}`,
192197
'lib',
193198
`${tool}.${version}`,
194199
'tools',
195-
`${tool}-${version}`,
200+
tool === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here
196201
tool === 'ghc' ? 'bin' : ''
197202
);
198203
core.addPath(chocoPath);

src/versions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"ghc": [
33
"8.10.2",
44
"8.10.2.2",
5-
"8.10.1.1",
65
"8.10.1",
7-
"8.8.4.1",
6+
"8.10.1.1",
87
"8.8.4",
9-
"8.8.3.2",
8+
"8.8.4.1",
109
"8.8.3",
11-
"8.8.2.1",
10+
"8.8.3.2",
1211
"8.8.2",
12+
"8.8.2.1",
1313
"8.8.1",
1414
"8.6.5",
1515
"8.6.4",

0 commit comments

Comments
 (0)