Add support for cs2pr and refactor tools code

This commit is contained in:
Shivam Mathur
2020-02-02 23:51:44 +05:30
parent 3454287b87
commit d3760be2cc
6 changed files with 70 additions and 28 deletions

View File

@ -114,6 +114,9 @@ Function Add-Tool() {
Add-Extension mbstring >$null 2>&1
Add-Extension xml >$null 2>&1
}
if($tool -eq "cs2pr") {
(Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr
}
if (((Get-ChildItem -Path $php_dir/* | Where-Object Name -Match "^$tool(.exe|.phar)*$").Count -gt 0)) {
Add-Log $tick $tool "Added"
} else {