mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Refactor addPhive in tools.ts
This commit is contained in:
parent
15b20027cf
commit
dab0e73adf
13
dist/index.js
vendored
13
dist/index.js
vendored
@ -732,17 +732,12 @@ async function addPhive(data) {
|
|||||||
case /7\.2/.test(data['php_version']):
|
case /7\.2/.test(data['php_version']):
|
||||||
data['version'] = '0.14.5';
|
data['version'] = '0.14.5';
|
||||||
break;
|
break;
|
||||||
}
|
case /^latest$/.test(data['version']):
|
||||||
if (data['version'] === 'latest') {
|
|
||||||
data['version'] = await getLatestVersion(data);
|
data['version'] = await getLatestVersion(data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
data['domain'] = [
|
data['extension'] = '-' + data['version'] + data['extension'];
|
||||||
data['github'],
|
data['url'] = await getUrl(data);
|
||||||
data['repository'],
|
|
||||||
'releases/download',
|
|
||||||
data['version']
|
|
||||||
].join('/');
|
|
||||||
data['url'] = await getPharUrl(data);
|
|
||||||
return await addArchive(data);
|
return await addArchive(data);
|
||||||
}
|
}
|
||||||
exports.addPhive = addPhive;
|
exports.addPhive = addPhive;
|
||||||
|
13
src/tools.ts
13
src/tools.ts
@ -327,17 +327,12 @@ export async function addPhive(data: RS): Promise<string> {
|
|||||||
case /7\.2/.test(data['php_version']):
|
case /7\.2/.test(data['php_version']):
|
||||||
data['version'] = '0.14.5';
|
data['version'] = '0.14.5';
|
||||||
break;
|
break;
|
||||||
}
|
case /^latest$/.test(data['version']):
|
||||||
if (data['version'] === 'latest') {
|
|
||||||
data['version'] = await getLatestVersion(data);
|
data['version'] = await getLatestVersion(data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
data['domain'] = [
|
data['extension'] = '-' + data['version'] + data['extension'];
|
||||||
data['github'],
|
data['url'] = await getUrl(data);
|
||||||
data['repository'],
|
|
||||||
'releases/download',
|
|
||||||
data['version']
|
|
||||||
].join('/');
|
|
||||||
data['url'] = await getPharUrl(data);
|
|
||||||
return await addArchive(data);
|
return await addArchive(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user