Throw configuration error when tar is not available
This commit is contained in:
parent
a1695c562b
commit
b500b62cea
9 changed files with 41 additions and 30 deletions
13
lib/tar.js
generated
13
lib/tar.js
generated
|
|
@ -42,17 +42,6 @@ const actions_util_1 = require("./actions-util");
|
|||
const util_1 = require("./util");
|
||||
const MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3";
|
||||
const MIN_REQUIRED_GNU_TAR_VERSION = "1.31";
|
||||
async function isBinaryAccessible(binary, logger) {
|
||||
try {
|
||||
await (0, safe_which_1.safeWhich)(binary);
|
||||
logger.debug(`Found ${binary}.`);
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug(`Could not find ${binary}: ${e}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function getTarVersion() {
|
||||
const tar = await (0, safe_which_1.safeWhich)("tar");
|
||||
let stdout = "";
|
||||
|
|
@ -86,7 +75,7 @@ async function getTarVersion() {
|
|||
}
|
||||
}
|
||||
async function isZstdAvailable(logger) {
|
||||
const foundZstdBinary = await isBinaryAccessible("zstd", logger);
|
||||
const foundZstdBinary = await (0, util_1.isBinaryAccessible)("zstd", logger);
|
||||
try {
|
||||
const tarVersion = await getTarVersion();
|
||||
const { type, version } = tarVersion;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue