clean files

This commit is contained in:
Opportunity
2021-07-16 11:08:18 +08:00
Unverified
parent 28277cf90d
commit 1d3e0c37b9
8 changed files with 81 additions and 88 deletions
+15 -15
View File
@@ -1,14 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unixInstall = void 0;
const core = require('@actions/core');
const exec_1 = require('@actions/exec');
const io = require('@actions/io');
const toolCache = require('@actions/tool-cache');
const os = require('os');
const path = require('path');
const semver = require('semver');
const git = require('./git');
const core = require("@actions/core");
const exec_1 = require("@actions/exec");
const io = require("@actions/io");
const toolCache = require("@actions/tool-cache");
const os = require("os");
const path = require("path");
const semver = require("semver");
const git = require("./git");
async function install(sourceDir, binDir) {
await exec_1.exec('make', ['build'], { cwd: sourceDir });
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
@@ -19,9 +19,7 @@ async function unixInstall(version) {
const ver = version.version;
toolDir = toolCache.find('xmake', ver);
if (!toolDir) {
const sourceDir = await core.group(`download xmake ${String(version)}`, () =>
git.create(version.repo, version.sha),
);
const sourceDir = await core.group(`download xmake ${String(version)}`, () => git.create(version.repo, version.sha));
toolDir = await core.group(`install xmake ${String(version)}`, async () => {
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
await install(sourceDir, binDir);
@@ -31,7 +29,8 @@ async function unixInstall(version) {
return cacheDir;
});
}
} else {
}
else {
toolDir = await core.group(`install local xmake at '${version.path}'`, async () => {
const binDir = path.join(os.tmpdir(), `xmake-${Date.now()}`);
await install(version.path, binDir);
@@ -40,7 +39,8 @@ async function unixInstall(version) {
}
if (version.type !== 'tags' || semver.gt(version.version, '2.3.1')) {
core.addPath(path.join(toolDir, 'bin'));
} else {
}
else {
core.addPath(path.join(toolDir, 'share', 'xmake'));
}
}