mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Improve regex in utils.parseVersion
This commit is contained in:
parent
86e1ccdd8d
commit
912f27c42c
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1121,7 +1121,7 @@ exports.fetch = fetch;
|
|||||||
async function parseVersion(version) {
|
async function parseVersion(version) {
|
||||||
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /latest|\d.x/.test(version):
|
case /^(latest|\d+\.x)$/.test(version):
|
||||||
return JSON.parse(await fetch(manifest))[version];
|
return JSON.parse(await fetch(manifest))[version];
|
||||||
default:
|
default:
|
||||||
switch (true) {
|
switch (true) {
|
||||||
|
@ -69,7 +69,7 @@ export async function fetch(url: string): Promise<string> {
|
|||||||
export async function parseVersion(version: string): Promise<string> {
|
export async function parseVersion(version: string): Promise<string> {
|
||||||
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /latest|\d.x/.test(version):
|
case /^(latest|\d+\.x)$/.test(version):
|
||||||
return JSON.parse(await fetch(manifest))[version];
|
return JSON.parse(await fetch(manifest))[version];
|
||||||
default:
|
default:
|
||||||
switch (true) {
|
switch (true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user