Update node_modules

This commit is contained in:
CrazyMax
2020-01-17 09:36:42 +01:00
parent 0249173616
commit 999f6ae5af
787 changed files with 76078 additions and 436 deletions

View File

@@ -16,14 +16,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const decompress = require("decompress");
const decompresstarxz = require("decompress-tarxz");
const download = __importStar(require("download"));
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const path = __importStar(require("path"));
const util = __importStar(require("util"));
const restm = __importStar(require("typed-rest-client/RestClient"));
const core = __importStar(require("@actions/core"));
const tc = __importStar(require("@actions/tool-cache"));
let osPlat = os.platform();
let osArch = os.arch();
function getUPX(version) {
@@ -32,24 +32,29 @@ function getUPX(version) {
if (selected) {
version = selected;
}
console.log(`✅ UPX version found: ${version}`);
core.info(`✅ UPX version found: ${version}`);
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'upx-'));
const fileName = getFileName(version);
const downloadUrl = util.format('https://github.com/upx/upx/releases/download/v%s/%s', version, fileName);
console.log(`⬇️ Downloading ${downloadUrl}...`);
core.info(`⬇️ Downloading ${downloadUrl}...`);
yield download.default(downloadUrl, tmpdir, { filename: fileName });
console.log('📦 Extracting UPX...');
core.info('📦 Extracting UPX...');
let extPath = tmpdir;
if (osPlat == 'win32') {
yield decompress(`${tmpdir}/${fileName}`, tmpdir, { strip: 1 });
extPath = yield tc.extractZip(`${tmpdir}/${fileName}`);
}
else {
yield decompresstarxz(`${tmpdir}/${fileName}`, tmpdir, { strip: 1 });
extPath = yield tc.extractTar(`${tmpdir}/${fileName}`, undefined, 'x');
}
return path.join(tmpdir, osPlat == 'win32' ? 'upx.exe' : 'upx');
return path.join(extPath, getFileNameWithoutExt(version), osPlat == 'win32' ? 'upx.exe' : 'upx');
});
}
exports.getUPX = getUPX;
function getFileName(version) {
const ext = osPlat == 'win32' ? 'zip' : 'tar.xz';
return util.format('%s.%s', getFileNameWithoutExt(version), ext);
}
function getFileNameWithoutExt(version) {
let platform = '';
if (osPlat == 'win32') {
platform = osArch == 'x64' ? 'win64' : 'win32';
@@ -57,8 +62,7 @@ function getFileName(version) {
else if (osPlat == 'linux') {
platform = osArch == 'x64' ? 'amd64_linux' : 'i386_linux';
}
const ext = osPlat == 'win32' ? 'zip' : 'tar.xz';
return util.format('upx-%s-%s.%s', version, platform, ext);
return util.format('upx-%s-%s', version, platform);
}
function determineVersion(version) {
return __awaiter(this, void 0, void 0, function* () {

View File

@@ -18,11 +18,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const installer = __importStar(require("./installer"));
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const core = __importStar(require("@actions/core"));
const exec = __importStar(require("@actions/exec"));
function run(silent) {
return __awaiter(this, void 0, void 0, function* () {
try {
if (os.platform() == 'darwin') {
core.setFailed('Not supported on darwin platform');
return;
}
const version = core.getInput('version') || 'latest';
const file = core.getInput('file', { required: true });
const args = core.getInput('args');