From ec0a82812d7471a74e9e5adf9d0bbd62f984303c Mon Sep 17 00:00:00 2001 From: "Matt M." Date: Thu, 7 Dec 2023 09:40:58 -0500 Subject: [PATCH] (datagrip) Strip `.0` suffix from installation directory When determining the installation directory for Datagrip, 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 #2257 . --- automatic/datagrip/tools/ChocolateyInstall.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automatic/datagrip/tools/ChocolateyInstall.ps1 b/automatic/datagrip/tools/ChocolateyInstall.ps1 index 1ae1f9bf511..168688ebb64 100644 --- a/automatic/datagrip/tools/ChocolateyInstall.ps1 +++ b/automatic/datagrip/tools/ChocolateyInstall.ps1 @@ -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\DataGrip $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\DataGrip $($env:ChocolateyPackageVersion -replace '.0$', '')" if ($pp.InstallDir) { $installDir = $pp.InstallDir }