This commit is contained in:
Opportunity
2020-07-07 21:53:34 +08:00
Unverified
parent 70a1af86e5
commit bff8013f3d
18 changed files with 200 additions and 181 deletions
+14 -3
View File
@@ -15,7 +15,13 @@ async function getVersions(repo: Repo): Promise<RefDic> {
}
class VersionImpl implements Version {
constructor(readonly repo: Repo, readonly version: string, readonly sha: Sha, readonly type: Version['type'], toString: string) {
constructor(
readonly repo: Repo,
readonly version: string,
readonly sha: Sha,
readonly type: Version['type'],
toString: string,
) {
this.#string = toString;
}
readonly #string: string;
@@ -80,7 +86,9 @@ async function selectSha(repo: Repo, sha: string): Promise<Version> {
return selectPr(repo, Number.parseInt(pr));
}
}
return Promise.resolve(new VersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`));
return Promise.resolve(
new VersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`),
);
}
export async function selectVersion(version?: string): Promise<Version> {
@@ -123,6 +131,9 @@ export async function selectVersion(version?: string): Promise<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)})` + (repo !== DEFAULT_REPO ? ` of ${repo}` : ''));
core.info(
`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''),
);
return ret;
}