Skip to content

Commit

Permalink
(chocolatey#2510) Don't run beforemodify on non-windows
Browse files Browse the repository at this point in the history
This sets the beforemodify script to only run on windows platforms.
The powershell scripts do not work on non-windows platforms, so they
should not be run.
  • Loading branch information
TheCakeIsNaOH authored and gep13 committed Jan 10, 2022
1 parent a6a0cd9 commit cdd90f4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,14 @@ public virtual ConcurrentDictionary<string, PackageResult> upgrade_run(Chocolate

private void before_package_modify(PackageResult packageResult, ChocolateyConfiguration config)
{
if (!config.SkipPackageInstallProvider)
if (!config.SkipPackageInstallProvider && config.Information.PlatformType == PlatformType.Windows)
{
_powershellService.before_modify(config, packageResult);
}
else
{
if (config.Information.PlatformType != PlatformType.Windows) this.Log().Info(ChocolateyLoggers.Important, () => " Skipping beforemodify Powershell script due to non-Windows.");
}
}

public void uninstall_noop(ChocolateyConfiguration config)
Expand Down

0 comments on commit cdd90f4

Please sign in to comment.