remove unused hacks
This commit is contained in:
@@ -14,9 +14,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const io = __importStar(require("@actions/io"));
|
||||
@@ -25,8 +22,6 @@ const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const restm = __importStar(require("typed-rest-client/RestClient"));
|
||||
const semver = __importStar(require("semver"));
|
||||
const v4_1 = __importDefault(require("uuid/v4"));
|
||||
const exec_1 = require("@actions/exec/lib/exec");
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
const IS_DARWIN = process.platform === 'darwin';
|
||||
const IS_LINUX = process.platform === 'linux';
|
||||
@@ -122,52 +117,13 @@ function extractFile(file, destDir) {
|
||||
throw new Error(`Failed to extract ${file} - it is a directory`);
|
||||
}
|
||||
if ('tar.xz' === extName()) {
|
||||
yield extractTarXz(file, destDir);
|
||||
yield tc.extractTar(file, destDir, 'x');
|
||||
}
|
||||
else {
|
||||
if (IS_DARWIN) {
|
||||
yield extractZipDarwin(file, destDir);
|
||||
}
|
||||
else {
|
||||
yield tc.extractZip(file, destDir);
|
||||
}
|
||||
yield tc.extractZip(file, destDir);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Extract a tar.xz
|
||||
*
|
||||
* @param file path to the tar.xz
|
||||
* @param dest destination directory. Optional.
|
||||
* @returns path to the destination directory
|
||||
*/
|
||||
function extractTarXz(file, dest) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!file) {
|
||||
throw new Error("parameter 'file' is required");
|
||||
}
|
||||
dest = dest || (yield _createExtractFolder(dest));
|
||||
const tarPath = yield io.which('tar', true);
|
||||
yield exec_1.exec(`"${tarPath}"`, ['xC', dest, '-f', file]);
|
||||
return dest;
|
||||
});
|
||||
}
|
||||
exports.extractTarXz = extractTarXz;
|
||||
function _createExtractFolder(dest) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!dest) {
|
||||
dest = path.join(tempDirectory, v4_1.default());
|
||||
}
|
||||
yield io.mkdirP(dest);
|
||||
return dest;
|
||||
});
|
||||
}
|
||||
function extractZipDarwin(file, dest) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip-darwin');
|
||||
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
|
||||
});
|
||||
}
|
||||
function determineVersion(version, channel) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (version.endsWith('.x') || version === '') {
|
||||
|
||||
Reference in New Issue
Block a user