add a type

This commit is contained in:
Opportunity
2019-10-16 16:01:13 +08:00
Unverified
parent 9043207118
commit b96b773b86
+3 -1
View File
@@ -4,10 +4,12 @@ import { downloadTool } from '@actions/tool-cache'
import * as _fs from 'fs'
const fs = _fs.promises
type VersionMap = { [v: string]: string }
export async function fetchVersions() {
const file = await downloadTool('https://raw.githubusercontent.com/xmake-io/github-action-setup-xmake/data/versions.json')
const versions = await fs.readFile(file, 'utf-8')
return JSON.parse(versions) as { [v: string]: string }
return JSON.parse(versions) as VersionMap
}
export async function selectVersion(version?: string) {