format code

This commit is contained in:
Opportunity
2021-07-16 11:03:34 +08:00
Unverified
parent 1ff6af7af3
commit 28277cf90d
7 changed files with 87 additions and 81 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,7 +19,9 @@ 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);
@@ -29,8 +31,7 @@ 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);
@@ -39,8 +40,7 @@ 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'));
}
}