mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-09 06:14:10 +07:00
Add tests for install.ts and update dependencies
This commit is contained in:
@ -48,6 +48,7 @@ function build(filename, version, os_version) {
|
||||
return yield utils.writeScript(filename, script);
|
||||
});
|
||||
}
|
||||
exports.build = build;
|
||||
/**
|
||||
* Run the script
|
||||
*/
|
||||
@ -57,17 +58,17 @@ function run() {
|
||||
let os_version = process.platform;
|
||||
let version = yield utils.getInput('php-version', true);
|
||||
// check the os version and run the respective script
|
||||
if (os_version == 'darwin') {
|
||||
let script_path = yield build('darwin.sh', version, os_version);
|
||||
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
|
||||
}
|
||||
else if (os_version == 'win32') {
|
||||
let script_path = yield build('win32.ps1', version, os_version);
|
||||
yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname);
|
||||
}
|
||||
else if (os_version == 'linux') {
|
||||
let script_path = yield build('linux.sh', version, os_version);
|
||||
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
|
||||
let script_path = '';
|
||||
switch (os_version) {
|
||||
case 'darwin':
|
||||
case 'linux':
|
||||
script_path = yield build(os_version + '.sh', version, os_version);
|
||||
yield exec_1.exec('sh ' + script_path + ' ' + version + ' ' + __dirname);
|
||||
break;
|
||||
case 'win32':
|
||||
script_path = yield build('win32.ps1', version, os_version);
|
||||
yield exec_1.exec('pwsh ' + script_path + ' -version ' + version + ' -dir ' + __dirname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
@ -75,5 +76,6 @@ function run() {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.run = run;
|
||||
// call the run function
|
||||
run();
|
||||
|
Reference in New Issue
Block a user