This commit is contained in:
OpportunityLiu
2020-03-31 19:26:35 +08:00
Unverified
parent e0ba2e3e91
commit 7a6538cab8
4 changed files with 22 additions and 18 deletions
+4 -3
View File
@@ -9,21 +9,22 @@ const path = require("path");
const semver = require("semver");
const git = require("./git");
async function unixInstall(version) {
let toolDir = toolCache.find('xmake', version.version);
const ver = version.version;
let toolDir = toolCache.find('xmake', ver);
if (!toolDir) {
const sourceDir = await core.group(`download xmake ${version}`, () => git.create(version.sha));
toolDir = await core.group(`install xmake ${version}`, async () => {
await exec_1.exec('make', ['build'], { cwd: sourceDir });
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', version.version);
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
await io.rmRF(binDir);
await git.cleanup(version.sha);
return cacheDir;
});
}
// for versions 2.3.2 and above, xmake will be installed directly into the bin directory, and no script will be used to wrap it.
if (version.type !== 'tags' || semver.gt(version.version, '2.3.1')) {
if (version.type !== 'tags' || semver.gt(ver, '2.3.1')) {
core.addPath(path.join(toolDir, 'bin'));
}
else {