Ship with @zeit/ncc

This commit is contained in:
Shivam Mathur
2019-11-24 05:14:53 +05:30
parent 3f6c88dec7
commit 1db0b0651d
37 changed files with 2628 additions and 3004 deletions

View File

@ -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) {

View File

@ -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
*