mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fix crash while trying to update with identical current and target version
Fixes #50
This commit is contained in:
parent
a45d0e2fbb
commit
77ebfc431f
3 changed files with 21 additions and 1 deletions
|
|
@ -26,7 +26,14 @@ function Get-IcingaPowerShellModuleArchive()
|
|||
|
||||
if ($null -ne $CurrentVersion -And $CurrentVersion -eq $Tag) {
|
||||
Write-Host ([string]::Format('Your "{0}" is already up-to-date', $ModuleName));
|
||||
return;
|
||||
return @{
|
||||
'DownloadUrl' = $DownloadUrl;
|
||||
'Version' = $Tag;
|
||||
'Directory' = '';
|
||||
'Archive' = '';
|
||||
'ModuleRoot' = (Get-IcingaFrameworkRootPath);
|
||||
'Installed' = $FALSE;
|
||||
};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -56,5 +63,6 @@ function Get-IcingaPowerShellModuleArchive()
|
|||
'Directory' = $DownloadDirectory;
|
||||
'Archive' = $DownloadDestination;
|
||||
'ModuleRoot' = (Get-IcingaFrameworkRootPath);
|
||||
'Installed' = $TRUE;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@ function Install-IcingaFrameworkPlugins()
|
|||
$RepositoryName = 'icinga-powershell-plugins';
|
||||
$Archive = Get-IcingaPowerShellModuleArchive -DownloadUrl $PluginsUrl -ModuleName 'Icinga Plugins' -Repository $RepositoryName;
|
||||
|
||||
if ($Archive.Installed -eq $FALSE) {
|
||||
return @{
|
||||
'PluginUrl' = $Archive.DownloadUrl
|
||||
};
|
||||
}
|
||||
|
||||
Write-Host ([string]::Format('Installing module into "{0}"', ($Archive.Directory)));
|
||||
Expand-IcingaZipArchive -Path $Archive.Archive -Destination $Archive.Directory | Out-Null;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,12 @@ function Install-IcingaFrameworkUpdate()
|
|||
$RepositoryName = 'icinga-powershell-framework';
|
||||
$Archive = Get-IcingaPowerShellModuleArchive -DownloadUrl $FrameworkUrl -ModuleName 'Icinga Framework' -Repository $RepositoryName;
|
||||
|
||||
if ($Archive.Installed -eq $FALSE) {
|
||||
return @{
|
||||
'PluginUrl' = $Archive.DownloadUrl
|
||||
};
|
||||
}
|
||||
|
||||
Write-Host ([string]::Format('Installing module into "{0}"', ($Archive.Directory)));
|
||||
Expand-IcingaZipArchive -Path $Archive.Archive -Destination $Archive.Directory | Out-Null;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue