From d5f09bf2fff7eef9712751e6b194d815814afe0f Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Thu, 28 Jan 2016 14:17:48 -0600 Subject: [PATCH] (GH-542) Don't Run templated automation scripts Exclude templates folders from the search for the automation scripts. --- .../infrastructure.app/services/PowershellService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 2a5e907bff..e211d38b78 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -70,7 +70,7 @@ public void noop_action(PackageResult packageResult, CommandNameType command) } var packageDirectory = packageResult.InstallLocation; - var installScript = _fileSystem.get_files(packageDirectory, file, SearchOption.AllDirectories); + var installScript = _fileSystem.get_files(packageDirectory, file, SearchOption.AllDirectories).Where(p => !p.to_lower().contains("\\templates\\")); if (installScript.Count() != 0) { var chocoInstall = installScript.FirstOrDefault(); @@ -169,7 +169,7 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack return installerRun; } - var powershellScript = _fileSystem.get_files(packageDirectory, file, SearchOption.AllDirectories); + var powershellScript = _fileSystem.get_files(packageDirectory, file, SearchOption.AllDirectories).Where(p => !p.to_lower().contains("\\templates\\")); if (powershellScript.Count() != 0) { var chocoPowerShellScript = powershellScript.FirstOrDefault();