mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-31 18:57:17 +07:00
Ship with @zeit/ncc
This commit is contained in:
@ -42,7 +42,7 @@ export async function build(
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
const os_version: string = process.platform;
|
||||
const version: string = await utils.getInput('php-version', true);
|
||||
const version: string = await utils.getVersion();
|
||||
// check the os version and run the respective script
|
||||
let script_path = '';
|
||||
switch (os_version) {
|
||||
|
18
src/utils.ts
18
src/utils.ts
@ -22,6 +22,24 @@ export async function getInput(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to read the PHP version.
|
||||
*/
|
||||
export async function getVersion(): Promise<string> {
|
||||
const version: string = await getInput('php-version', true);
|
||||
switch (version) {
|
||||
case '8.0':
|
||||
case '8.0-dev':
|
||||
case '7.4':
|
||||
case '7.4snapshot':
|
||||
case '7.4nightly':
|
||||
case 'nightly':
|
||||
return '7.4';
|
||||
default:
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Async foreach loop
|
||||
*
|
||||
|
Reference in New Issue
Block a user