mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Make sure printf is in PATH in Windows
This commit is contained in:
parent
446bccb14d
commit
ab62fff526
@ -43,6 +43,19 @@ Function Add-ToProfile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Add-Printf {
|
||||||
|
if (-not(Test-Path "C:\Program Files\Git\usr\bin\printf.exe")) {
|
||||||
|
if(Test-Path "C:\msys64\usr\bin\printf.exe") {
|
||||||
|
New-Item -Path $php_dir\printf.exe -ItemType SymbolicLink -Value C:\msys64\usr\bin\printf.exe
|
||||||
|
} else {
|
||||||
|
Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/shivammathur/printf/releases/latest/download/printf-x64.zip" -OutFile "$php_dir\printf.zip"
|
||||||
|
Expand-Archive -Path $php_dir\printf.zip -DestinationPath $php_dir -Force
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
New-Item -Path $php_dir\printf.exe -ItemType SymbolicLink -Value "C:\Program Files\Git\usr\bin\printf.exe"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Function Install-PhpManager() {
|
Function Install-PhpManager() {
|
||||||
$module_path = "$php_dir\PhpManager\PhpManager.psm1"
|
$module_path = "$php_dir\PhpManager\PhpManager.psm1"
|
||||||
if(-not (Test-Path $module_path -PathType Leaf)) {
|
if(-not (Test-Path $module_path -PathType Leaf)) {
|
||||||
@ -238,6 +251,7 @@ if(-not(Test-Path -LiteralPath $current_profile)) {
|
|||||||
New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1
|
New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Add-Printf >$null 2>&1
|
||||||
Step-Log "Setup PhpManager"
|
Step-Log "Setup PhpManager"
|
||||||
Install-PhpManager >$null 2>&1
|
Install-PhpManager >$null 2>&1
|
||||||
Add-Log $tick "PhpManager" "Installed"
|
Add-Log $tick "PhpManager" "Installed"
|
||||||
|
Loading…
Reference in New Issue
Block a user