Skip to content

Commit 09d5694

Browse files
Support latest-nightly
1 parent 34d70fb commit 09d5694

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ E.g., `8.10` will be resolved to `8.10.7`, and so will `8`.
236236

237237
**GHC:**
238238

239+
- `latest-nightly`
239240
- `latest` (default)
240241
- `9.6.2` `9.6`
241242
- `9.6.1`

dist/index.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13400,12 +13400,21 @@ async function installTool(tool, version, os) {
1340013400
}
1340113401
switch (os) {
1340213402
case 'linux':
13403-
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
13404-
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
13405-
// Atm, I do not know how to check whether we are on ubuntu-20.04.
13406-
// So, ignore the error.
13407-
// if (!(await aptLibCurses5())) break;
13408-
await aptLibNCurses5();
13403+
if (tool === 'ghc') {
13404+
if (version === 'latest-nightly') {
13405+
await exec(await ghcupBin(os), [
13406+
'config',
13407+
'add-release-channel',
13408+
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
13409+
]);
13410+
}
13411+
else if ((0, compare_versions_1.compareVersions)('8.3', version)) {
13412+
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
13413+
// Atm, I do not know how to check whether we are on ubuntu-20.04.
13414+
// So, ignore the error.
13415+
// if (!(await aptLibCurses5())) break;
13416+
await aptLibNCurses5();
13417+
}
1340913418
}
1341013419
await ghcup(tool, version, os);
1341113420
if (await isInstalled(tool, version, os))

lib/installer.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,21 @@ async function installTool(tool, version, os) {
155155
}
156156
switch (os) {
157157
case 'linux':
158-
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
159-
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
160-
// Atm, I do not know how to check whether we are on ubuntu-20.04.
161-
// So, ignore the error.
162-
// if (!(await aptLibCurses5())) break;
163-
await aptLibNCurses5();
158+
if (tool === 'ghc') {
159+
if (version === 'latest-nightly') {
160+
await exec(await ghcupBin(os), [
161+
'config',
162+
'add-release-channel',
163+
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
164+
]);
165+
}
166+
else if ((0, compare_versions_1.compareVersions)('8.3', version)) {
167+
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
168+
// Atm, I do not know how to check whether we are on ubuntu-20.04.
169+
// So, ignore the error.
170+
// if (!(await aptLibCurses5())) break;
171+
await aptLibNCurses5();
172+
}
164173
}
165174
await ghcup(tool, version, os);
166175
if (await isInstalled(tool, version, os))

src/installer.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,20 @@ export async function installTool(
165165

166166
switch (os) {
167167
case 'linux':
168-
if (tool === 'ghc' && compareVersions('8.3', version)) {
169-
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
170-
// Atm, I do not know how to check whether we are on ubuntu-20.04.
171-
// So, ignore the error.
172-
// if (!(await aptLibCurses5())) break;
173-
await aptLibNCurses5();
168+
if (tool === 'ghc') {
169+
if (version === 'latest-nightly') {
170+
await exec(await ghcupBin(os), [
171+
'config',
172+
'add-release-channel',
173+
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
174+
]);
175+
} else if (compareVersions('8.3', version)) {
176+
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
177+
// Atm, I do not know how to check whether we are on ubuntu-20.04.
178+
// So, ignore the error.
179+
// if (!(await aptLibCurses5())) break;
180+
await aptLibNCurses5();
181+
}
174182
}
175183
await ghcup(tool, version, os);
176184
if (await isInstalled(tool, version, os)) return;

0 commit comments

Comments
 (0)