mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-17 16:08:27 +00:00
chore: generate
This commit is contained in:
parent
80e6212504
commit
b8ed624447
2 changed files with 16 additions and 24 deletions
20
dist/post_run/index.js
vendored
20
dist/post_run/index.js
vendored
|
|
@ -583,12 +583,13 @@ function unlinkFile(filePath) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.unlinkFile = unlinkFile;
|
exports.unlinkFile = unlinkFile;
|
||||||
function getVersion(app) {
|
function getVersion(app, additionalArgs = []) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.debug(`Checking ${app} --version`);
|
|
||||||
let versionOutput = '';
|
let versionOutput = '';
|
||||||
|
additionalArgs.push('--version');
|
||||||
|
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||||
try {
|
try {
|
||||||
yield exec.exec(`${app} --version`, [], {
|
yield exec.exec(`${app}`, additionalArgs, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
|
|
@ -608,19 +609,14 @@ function getVersion(app) {
|
||||||
// Use zstandard if possible to maximize cache performance
|
// Use zstandard if possible to maximize cache performance
|
||||||
function getCompressionMethod() {
|
function getCompressionMethod() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const versionOutput = yield getVersion('zstd');
|
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||||
const version = semver.clean(versionOutput);
|
const version = semver.clean(versionOutput);
|
||||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
core.debug(`zstd version: ${version}`);
|
||||||
// zstd is not installed
|
if (versionOutput === '') {
|
||||||
return constants_1.CompressionMethod.Gzip;
|
return constants_1.CompressionMethod.Gzip;
|
||||||
}
|
}
|
||||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
|
||||||
// zstd is installed but using a version earlier than v1.3.2
|
|
||||||
// v1.3.2 is required to use the `--long` options in zstd
|
|
||||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return constants_1.CompressionMethod.Zstd;
|
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
dist/run/index.js
vendored
20
dist/run/index.js
vendored
|
|
@ -583,12 +583,13 @@ function unlinkFile(filePath) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.unlinkFile = unlinkFile;
|
exports.unlinkFile = unlinkFile;
|
||||||
function getVersion(app) {
|
function getVersion(app, additionalArgs = []) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.debug(`Checking ${app} --version`);
|
|
||||||
let versionOutput = '';
|
let versionOutput = '';
|
||||||
|
additionalArgs.push('--version');
|
||||||
|
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
||||||
try {
|
try {
|
||||||
yield exec.exec(`${app} --version`, [], {
|
yield exec.exec(`${app}`, additionalArgs, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
|
|
@ -608,19 +609,14 @@ function getVersion(app) {
|
||||||
// Use zstandard if possible to maximize cache performance
|
// Use zstandard if possible to maximize cache performance
|
||||||
function getCompressionMethod() {
|
function getCompressionMethod() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const versionOutput = yield getVersion('zstd');
|
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
||||||
const version = semver.clean(versionOutput);
|
const version = semver.clean(versionOutput);
|
||||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
core.debug(`zstd version: ${version}`);
|
||||||
// zstd is not installed
|
if (versionOutput === '') {
|
||||||
return constants_1.CompressionMethod.Gzip;
|
return constants_1.CompressionMethod.Gzip;
|
||||||
}
|
}
|
||||||
else if (!version || semver.lt(version, 'v1.3.2')) {
|
|
||||||
// zstd is installed but using a version earlier than v1.3.2
|
|
||||||
// v1.3.2 is required to use the `--long` options in zstd
|
|
||||||
return constants_1.CompressionMethod.ZstdWithoutLong;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return constants_1.CompressionMethod.Zstd;
|
return constants_1.CompressionMethod.ZstdWithoutLong;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue