Skip to content

Commit

Permalink
Support latest-nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Jul 3, 2023
1 parent 34d70fb commit 09d5694
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ E.g., `8.10` will be resolved to `8.10.7`, and so will `8`.

**GHC:**

- `latest-nightly`
- `latest` (default)
- `9.6.2` `9.6`
- `9.6.1`
Expand Down
21 changes: 15 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13400,12 +13400,21 @@ async function installTool(tool, version, os) {
}
switch (os) {
case 'linux':
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
if (tool === 'ghc') {
if (version === 'latest-nightly') {
await exec(await ghcupBin(os), [
'config',
'add-release-channel',
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
]);
}
else if ((0, compare_versions_1.compareVersions)('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
}
}
await ghcup(tool, version, os);
if (await isInstalled(tool, version, os))
Expand Down
21 changes: 15 additions & 6 deletions lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,21 @@ async function installTool(tool, version, os) {
}
switch (os) {
case 'linux':
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
if (tool === 'ghc') {
if (version === 'latest-nightly') {
await exec(await ghcupBin(os), [
'config',
'add-release-channel',
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
]);
}
else if ((0, compare_versions_1.compareVersions)('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
}
}
await ghcup(tool, version, os);
if (await isInstalled(tool, version, os))
Expand Down
20 changes: 14 additions & 6 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,20 @@ export async function installTool(

switch (os) {
case 'linux':
if (tool === 'ghc' && compareVersions('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
if (tool === 'ghc') {
if (version === 'latest-nightly') {
await exec(await ghcupBin(os), [
'config',
'add-release-channel',
'https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml'
]);
} else if (compareVersions('8.3', version)) {
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
// Atm, I do not know how to check whether we are on ubuntu-20.04.
// So, ignore the error.
// if (!(await aptLibCurses5())) break;
await aptLibNCurses5();
}
}
await ghcup(tool, version, os);
if (await isInstalled(tool, version, os)) return;
Expand Down

0 comments on commit 09d5694

Please sign in to comment.