mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Use releases instead of tags to download PowerShell PhpManager
I just started to publish PhpManager to GitHub Releases too
This commit is contained in:
parent
1444e002ab
commit
29d99c6866
@ -45,13 +45,15 @@ Function Add-ToProfile {
|
|||||||
|
|
||||||
Function Install-PhpManager() {
|
Function Install-PhpManager() {
|
||||||
$repo = "mlocati/powershell-phpmanager"
|
$repo = "mlocati/powershell-phpmanager"
|
||||||
$zip_file = "$php_dir\PhpManager.zip"
|
$tag = (Invoke-RestMethod https://api.github.com/repos/$repo/releases/latest).tag_name
|
||||||
$tag = (Invoke-RestMethod https://api.github.com/repos/$repo/tags)[0].Name
|
$module_path = "$bin_dir\PhpManager\powershell-phpmanager-$tag\PhpManager\PhpManager.psm1"
|
||||||
$module_path = "$php_dir\PhpManager\powershell-phpmanager-$tag\PhpManager"
|
if(-not (Test-Path $module_path -PathType Leaf)) {
|
||||||
|
$zip_file = "$bin_dir\PhpManager.zip"
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file
|
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file
|
||||||
Expand-Archive -Path $zip_file -DestinationPath $php_dir\PhpManager -Force
|
Expand-Archive -Path $zip_file -DestinationPath $bin_dir\PhpManager -Force
|
||||||
|
}
|
||||||
Import-Module $module_path
|
Import-Module $module_path
|
||||||
Add-ToProfile $current_profile "PhpManager" "Import-Module $module_path"
|
Add-ToProfile $current_profile 'powershell-phpmanager' "Import-Module $module_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Add-Extension {
|
Function Add-Extension {
|
||||||
|
Loading…
Reference in New Issue
Block a user