Skip to content

Commit

Permalink
(webstorm) Strip .0 suffix from installation directory
Browse files Browse the repository at this point in the history
When determining the installation directory for Webstorm, remove
any `.0` suffix that might be present in the version number.
Jetbrains doesn't use this part of the release version number when
installing, so this causes Chocolatey to create an empty
directory that never gets used or cleaned up.

Fixes issue chocolatey-community#2266 .
  • Loading branch information
9numbernine9 committed Dec 7, 2023
1 parent bc5e651 commit 15a2526
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion automatic/webstorm/tools/ChocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$programFiles = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0]
$pp = Get-PackageParameters

$installDir = "$programFiles\JetBrains\WebStorm $env:ChocolateyPackageVersion"
# If the release version ends in '.0', remove this since JetBrains don't
# use this part of the version number when creating the installation directory.
$installDir = "$programFiles\JetBrains\WebStorm $($env:ChocolateyPackageVersion -replace '.0$', '')"
if ($pp.InstallDir) {
$installDir = $pp.InstallDir
}
Expand Down

0 comments on commit 15a2526

Please sign in to comment.