This commit is contained in:
Opportunity
2020-06-30 10:23:33 +08:00
Unverified
parent 48f33e8789
commit b94221136f
3 changed files with 19 additions and 4 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ const core = require("@actions/core");
const semver = require("semver");
const git_1 = require("./git");
const interfaces_1 = require("./interfaces");
const DEFAULT_REPO = interfaces_1.Repo('xmake-io/xmake');
const VERSIONS = new Map();
async function getVersions(repo) {
const cache = VERSIONS.get(repo);
@@ -102,7 +103,7 @@ async function selectVersion(version) {
version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest';
if (version.toLowerCase() === 'latest')
version = '';
let repo = interfaces_1.Repo('xmake-io/xmake');
let repo = DEFAULT_REPO;
let ret;
{
const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version);
@@ -136,7 +137,7 @@ async function selectVersion(version) {
if (!ret) {
throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`);
}
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})`);
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` + (repo !== DEFAULT_REPO ? ` of ${repo}` : ''));
return ret;
}
exports.selectVersion = selectVersion;