Skip to content

Commit 59efea6

Browse files
committed
Show message and do not attempt to upgrade if upgrading to same version
1 parent 3413e35 commit 59efea6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

JsLibraryPackaging.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ function Update-BowerLibrary ($name, $version = $null) {
145145
$newVersion = $packageInfo.version
146146
}
147147

148+
$oldVersionFolder = Get-Item "$($folderName)_*"
149+
if ($oldVersionFolder.Name -eq "$($folderName)_$newVersion") {
150+
Write-Warning "Attempting to upgrade $name to $newVersion when it is already that version"
151+
return
152+
}
153+
148154
$allPaths = (bower list --paths --json) -join "`n" | ConvertFrom-Json
149155
$paths = @($allPaths.$folderName)
150156
$jsPaths = @($paths | ? { $_ -match '\.js$' })
@@ -164,7 +170,6 @@ function Update-BowerLibrary ($name, $version = $null) {
164170
$jsFile = $minJsFile
165171
}
166172

167-
$oldVersionFolder = Get-Item "$($folderName)_*"
168173
cp $jsFile $oldVersionFolder.Name
169174

170175
Update-JavaScriptLibrary $folderName $newVersion

0 commit comments

Comments
 (0)