Skip to content

Commit

Permalink
fix: guard xz archives with a flag and disable it (it's slower than e…
Browse files Browse the repository at this point in the history
…xpected)

Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Dec 5, 2023
1 parent cdae669 commit f2f6241
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/releases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {

const downloadPathV1 = 'cli'

const ENABLE_XZ = false

/**
* Version info resolved for a release of Buildless.
*/
Expand Down Expand Up @@ -287,17 +289,19 @@ async function maybeDownload(
defaultArchiveType = ArchiveType.ZIP
}

// check for `xz` support, use it if we can, the archives are smaller
try {
await io.which('xz', true)
defaultArchiveType = ArchiveType.XZ
core.debug(`Tool 'xz' found; using xz-based archives.`)
} catch (err) {
/* istanbul ignore next */
core.debug(
'Tool `xz` is not available on the host system; falling back to gzip archives.'
)
defaultArchiveType = ArchiveType.GZIP
if (ENABLE_XZ) {
// check for `xz` support, use it if we can, the archives are smaller
try {
await io.which('xz', true)
defaultArchiveType = ArchiveType.XZ
core.debug(`Tool 'xz' found; using xz-based archives.`)
} catch (err) {
/* istanbul ignore next */
core.debug(
'Tool `xz` is not available on the host system; falling back to gzip archives.'
)
defaultArchiveType = ArchiveType.GZIP
}
}

// build download URL, use result from cache or disk
Expand Down

0 comments on commit f2f6241

Please sign in to comment.