mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 05:01:07 +07:00
Fix regression in major/minor.major version support for phpunit
This commit is contained in:
parent
948bd8df3c
commit
d2f333de6f
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -946,7 +946,7 @@ exports.addPhive = addPhive;
|
|||||||
async function addPHPUnitTools(data) {
|
async function addPHPUnitTools(data) {
|
||||||
if (data['version'] === 'latest') {
|
if (data['version'] === 'latest') {
|
||||||
data['version'] =
|
data['version'] =
|
||||||
(await packagist.search(data['repository'], data['php_version'])) ??
|
(await packagist.search(data['packagist'], data['php_version'])) ??
|
||||||
'latest';
|
'latest';
|
||||||
}
|
}
|
||||||
data['url'] = await getPharUrl(data);
|
data['url'] = await getPharUrl(data);
|
||||||
@ -1000,6 +1000,7 @@ async function getData(release, php_version, os) {
|
|||||||
data['extension'] ??= '.phar';
|
data['extension'] ??= '.phar';
|
||||||
data['os'] = os;
|
data['os'] = os;
|
||||||
data['php_version'] = php_version;
|
data['php_version'] = php_version;
|
||||||
|
data['packagist'] ??= data['repository'];
|
||||||
data['prefix'] = data['github'] === data['domain'] ? 'releases' : '';
|
data['prefix'] = data['github'] === data['domain'] ? 'releases' : '';
|
||||||
data['verb'] = data['github'] === data['domain'] ? 'download' : '';
|
data['verb'] = data['github'] === data['domain'] ? 'download' : '';
|
||||||
data['fetch_latest'] ??= 'false';
|
data['fetch_latest'] ??= 'false';
|
||||||
|
@ -267,7 +267,8 @@
|
|||||||
},
|
},
|
||||||
"phpunit": {
|
"phpunit": {
|
||||||
"type": "custom-function",
|
"type": "custom-function",
|
||||||
"repository": "phpunit/phpunit",
|
"repository": "sebastianbergmann/phpunit",
|
||||||
|
"packagist": "phpunit/phpunit",
|
||||||
"domain": "https://phar.phpunit.de",
|
"domain": "https://phar.phpunit.de",
|
||||||
"function": "phpunit",
|
"function": "phpunit",
|
||||||
"version_prefix": "",
|
"version_prefix": "",
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"fetch_latest": "true",
|
"fetch_latest": "true",
|
||||||
"function": "function_name",
|
"function": "function_name",
|
||||||
"repository": "user/tool",
|
"repository": "user/tool",
|
||||||
|
"packagist": "user/tool",
|
||||||
"scope": "global, scoped",
|
"scope": "global, scoped",
|
||||||
"type": "phar, composer, custom-package or custom-function",
|
"type": "phar, composer, custom-package or custom-function",
|
||||||
"version_parameter": "--version",
|
"version_parameter": "--version",
|
||||||
@ -77,6 +78,15 @@
|
|||||||
"user/tool"
|
"user/tool"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"packagist": {
|
||||||
|
"$id": "#/items/properties/packagist",
|
||||||
|
"type": "string",
|
||||||
|
"title": "The repository schema",
|
||||||
|
"description": "Packagist repository of the tool in case different from repository.",
|
||||||
|
"examples": [
|
||||||
|
"user/tool"
|
||||||
|
]
|
||||||
|
},
|
||||||
"scope": {
|
"scope": {
|
||||||
"$id": "#/items/properties/scope",
|
"$id": "#/items/properties/scope",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -395,7 +395,7 @@ export async function addPhive(data: RS): Promise<string> {
|
|||||||
export async function addPHPUnitTools(data: RS): Promise<string> {
|
export async function addPHPUnitTools(data: RS): Promise<string> {
|
||||||
if (data['version'] === 'latest') {
|
if (data['version'] === 'latest') {
|
||||||
data['version'] =
|
data['version'] =
|
||||||
(await packagist.search(data['repository'], data['php_version'])) ??
|
(await packagist.search(data['packagist'], data['php_version'])) ??
|
||||||
'latest';
|
'latest';
|
||||||
}
|
}
|
||||||
data['url'] = await getPharUrl(data);
|
data['url'] = await getPharUrl(data);
|
||||||
@ -464,6 +464,7 @@ export async function getData(
|
|||||||
data['extension'] ??= '.phar';
|
data['extension'] ??= '.phar';
|
||||||
data['os'] = os;
|
data['os'] = os;
|
||||||
data['php_version'] = php_version;
|
data['php_version'] = php_version;
|
||||||
|
data['packagist'] ??= data['repository'];
|
||||||
data['prefix'] = data['github'] === data['domain'] ? 'releases' : '';
|
data['prefix'] = data['github'] === data['domain'] ? 'releases' : '';
|
||||||
data['verb'] = data['github'] === data['domain'] ? 'download' : '';
|
data['verb'] = data['github'] === data['domain'] ? 'download' : '';
|
||||||
data['fetch_latest'] ??= 'false';
|
data['fetch_latest'] ??= 'false';
|
||||||
|
Loading…
Reference in New Issue
Block a user