Add tests for install.ts and update dependencies

This commit is contained in:
Shivam Mathur
2019-10-30 09:16:37 +05:30
parent d27b4a7bc7
commit aa2af38672
159 changed files with 375 additions and 12451 deletions

View File

@ -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();