Compare commits

...

2 Commits

Author SHA1 Message Date
Shivam Mathur
7729e411ec Improve enabling gearman [skip ci] 2026-04-29 01:00:16 +05:30
Shivam Mathur
af2322b95c Fix fallback in Install-PSPackage on Windows 2026-04-26 23:49:26 +05:30
2 changed files with 14 additions and 10 deletions

View File

@@ -1,9 +1,9 @@
# Helper function to add gearman extension. # Helper function to add gearman extension.
add_gearman_helper() { add_gearman_helper() {
install_packages libgearman-dev
enable_extension gearman extension enable_extension gearman extension
if ! check_extension gearman; then if ! check_extension gearman; then
status="Installed and enabled" status="Installed and enabled"
install_packages libgearman-dev
if [[ "${version:?}" =~ 5.[3-6] ]]; then if [[ "${version:?}" =~ 5.[3-6] ]]; then
pecl_install gearman-1.1.2 pecl_install gearman-1.1.2
elif [[ "${version:?}" =~ 7.0 ]]; then elif [[ "${version:?}" =~ 7.0 ]]; then

View File

@@ -203,16 +203,20 @@ Function Install-PSPackage() {
$cmdlet $cmdlet
) )
$module_path = "$bin_dir\$psm1_path.psm1" $module_path = "$bin_dir\$psm1_path.psm1"
if(-not (Test-Path $module_path -PathType Leaf)) { $imported = $false
$zip_file = "$bin_dir\$package.zip" try {
Get-File -Url $url -OutFile $zip_file if(-not (Test-Path $module_path -PathType Leaf)) {
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force $zip_file = "$bin_dir\$package.zip"
} Get-File -Url $url -OutFile $zip_file
Import-Module $module_path Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force -ErrorAction Stop
if($null -eq (Get-Command $cmdlet -ErrorAction SilentlyContinue)) { }
Install-Module -Name $package -Force Import-Module $module_path -ErrorAction Stop
} else { $imported = $null -ne (Get-Command $cmdlet -ErrorAction SilentlyContinue)
} catch { }
if($imported) {
Add-ToProfile $current_profile "$package-search" "Import-Module $module_path" Add-ToProfile $current_profile "$package-search" "Import-Module $module_path"
} else {
Install-Module -Name $package -Force
} }
} }