Skip to content

Commit

Permalink
Use custom download URL on Linux/Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMayes committed Oct 10, 2023
1 parent 878985d commit be40c5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ function getLinuxUrl(version: string, options: Options): string | null {

const prefix = "clang+llvm-";
const suffix = `-x86_64-linux-gnu${ubuntu}.tar.xz`;
if (compareVersions(version, "9.0.1") >= 0) {
if (options.downloadUrl) {
return getDownloadUrl(options.downloadUrl, version, prefix, suffix);
} else if (compareVersions(version, "9.0.1") >= 0) {
return getGitHubUrl(version, prefix, suffix);
} else {
return getReleaseUrl(version, prefix, suffix);
Expand All @@ -297,7 +299,9 @@ function getWin32Url(version: string, options: Options): string | null {

const prefix = "LLVM-";
const suffix = compareVersions(version, "3.7.0") >= 0 ? "-win64.exe" : "-win32.exe";
if (compareVersions(version, "9.0.1") >= 0) {
if (options.downloadUrl) {
return getDownloadUrl(options.downloadUrl, version, prefix, suffix);
} else if (compareVersions(version, "9.0.1") >= 0) {
return getGitHubUrl(version, prefix, suffix);
} else {
return getReleaseUrl(version, prefix, suffix);
Expand Down

0 comments on commit be40c5a

Please sign in to comment.