mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Remove call to getManifestURL unless needed in utils.parseVersion
This commit is contained in:
parent
755bbb1cc0
commit
f42145a164
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -1072,10 +1072,9 @@ async function getManifestURL() {
|
|||||||
}
|
}
|
||||||
exports.getManifestURL = getManifestURL;
|
exports.getManifestURL = getManifestURL;
|
||||||
async function parseVersion(version) {
|
async function parseVersion(version) {
|
||||||
const manifest = await getManifestURL();
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^(latest|nightly|\d+\.x)$/.test(version):
|
case /^(latest|nightly|\d+\.x)$/.test(version):
|
||||||
return JSON.parse((await fetch.fetch(manifest))['data'])[version];
|
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[version];
|
||||||
default:
|
default:
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case version.length > 1:
|
case version.length > 1:
|
||||||
|
@ -58,10 +58,11 @@ export async function getManifestURL(): Promise<string> {
|
|||||||
* @param version
|
* @param version
|
||||||
*/
|
*/
|
||||||
export async function parseVersion(version: string): Promise<string> {
|
export async function parseVersion(version: string): Promise<string> {
|
||||||
const manifest = await getManifestURL();
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^(latest|nightly|\d+\.x)$/.test(version):
|
case /^(latest|nightly|\d+\.x)$/.test(version):
|
||||||
return JSON.parse((await fetch.fetch(manifest))['data'])[version];
|
return JSON.parse((await fetch.fetch(await getManifestURL()))['data'])[
|
||||||
|
version
|
||||||
|
];
|
||||||
default:
|
default:
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case version.length > 1:
|
case version.length > 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user