Skip to content

Commit

Permalink
Renamed Get-Padded-Version to Get-PaddedVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Apr 24, 2017
1 parent dff633c commit 578c031
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions automatic/GoogleChrome/update.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import-module au
. "$PSScriptRoot\..\..\scripts\Get-Padded-Version.ps1"
import-module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

$releases = 'http://omahaproxy.appspot.com/all?os=win&channel=stable'
$paddedUnderVersion = '57.0.2988'
Expand Down Expand Up @@ -28,7 +28,7 @@ function global:au_GetLatest {
@{
URL32 = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise.msi'
URL64 = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'
Version = Get-Padded-Version -Version $version -OnlyBelowVersion $paddedUnderVersion -RevisionLength 5
Version = Get-PaddedVersion -Version $version -OnlyBelowVersion $paddedUnderVersion -RevisionLength 5
RemoteVersion = $version
}
}
Expand Down
4 changes: 2 additions & 2 deletions automatic/flashplayeractivex/update.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import-module au
. "$PSScriptRoot\..\..\scripts\Get-Padded-Version.ps1"
import-module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

$releases = 'http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_win_pl.xml'
$padVersionUnder = '24.0.1'
Expand Down Expand Up @@ -34,7 +34,7 @@ function global:au_GetLatest {

$url32 = "https://download.macromedia.com/pub/flashplayer/pdc/${CurrentVersion}/install_flash_player_${majorVersion}_active_x.msi"

$packageVersion = Get-Padded-Version $CurrentVersion $padVersionUnder
$packageVersion = Get-PaddedVersion $CurrentVersion $padVersionUnder

return @{ URL32 = $url32; Version = $packageVersion; RemoteVersion = $CurrentVersion; majorVersion = $majorVersion; }
}
Expand Down
8 changes: 4 additions & 4 deletions automatic/flashplayerplugin/update.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import-module au
. "$PSScriptRoot\..\..\scripts\Get-Padded-Version.ps1"
import-module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

$releases = 'http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_win_pl.xml'
$padVersionUnder = '24.0.1'
Expand All @@ -16,14 +16,14 @@ function global:au_SearchReplace {
}

function global:au_GetLatest {

$XML = New-Object System.Xml.XmlDocument
$XML.load($releases)
$version = $XML.XML.update.version.replace(',', '.')
$major_version = ([version]$version).Major

@{
Version = Get-Padded-Version $version $padVersionUnder
Version = Get-PaddedVersion $version $padVersionUnder
URL32 = "https://download.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_${major_version}_plugin.msi"
}
}
Expand Down
4 changes: 2 additions & 2 deletions automatic/flashplayerppapi/update.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import-module au
. "$PSScriptRoot\..\..\scripts\Get-Padded-Version.ps1"
import-module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

$releases = 'http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_win_pl.xml'
$padVersionUnder = '24.0.1'
Expand Down Expand Up @@ -33,7 +33,7 @@ function global:au_GetLatest {

return @{
URL32 = $url32
Version = Get-Padded-Version $currentVersion $padVersionUnder
Version = Get-PaddedVersion $currentVersion $padVersionUnder
}
}

Expand Down
4 changes: 2 additions & 2 deletions automatic/pyhoca-gui/update.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Import-Module AU
. "$PSScriptRoot\..\..\scripts\Get-Padded-Version.ps1"
import-module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

$releases = 'http://code.x2go.org/releases/binary-win32/pyhoca-gui/releases/'
$softwareName = 'PyHoca-GUI'
Expand Down Expand Up @@ -53,7 +53,7 @@ function global:au_GetLatest {

@{
URL32 = $url32
Version = Get-Padded-Version $version32 $padVersionUnder -RevisionLength 4
Version = Get-PaddedVersion $version32 $padVersionUnder -RevisionLength 4
VerifyChecksum32 = $checksum32
VersionReleaseUrl = $releases + $versionDir
}
Expand Down
2 changes: 1 addition & 1 deletion automatic/wixtoolset/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function global:au_GetLatest {

@{
URL32 = [uri]$builder.ToString()
Version = Get-Padded-Version $version32 -OnlyBelowVersion $padUnderVersion
Version = Get-PaddedVersion $version32 -OnlyBelowVersion $padUnderVersion
ReleasesUrl = $redirectPage
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
The full padded version, or the specified Version if padding was not needed.
.EXAMPLE
Get-Padded-Version -Version '24.0.0.195'
Get-PaddedVersion -Version '24.0.0.195'
will output '24.0.0.195000' if the nuspec version is less than the version
.EXAMPLE
Get-Padded-Version -Version '24.0.0.195'
Get-PaddedVersion -Version '24.0.0.195'
will output '24.0.0.195001' if the nuspec version is equal to '24.0.0.195'
or equal to '24.0.0.195000'
.EXAMPLE
Get-Padded-Version -Version '24.0.1.2' -OnlyBelowVersion '24.0.1'
Get-PaddedVersion -Version '24.0.1.2' -OnlyBelowVersion '24.0.1'
Will output the same version that was given without padded zeroes.
#>

function Get-Padded-Version() {
function Get-PaddedVersion() {
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Version,
Expand Down
2 changes: 1 addition & 1 deletion scripts/au_extensions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# but the file containing the functions is expected
# to be named using the same name.
$funcs = @(
'Get-Padded-Version'
'Get-PaddedVersion'
'Set-DescriptionFromReadme'
)

Expand Down

0 comments on commit 578c031

Please sign in to comment.