Skip to content

Commit

Permalink
(chocolateyGH-542) Don't Run templated automation scripts
Browse files Browse the repository at this point in the history
Exclude templates folders from the search for the automation scripts.
  • Loading branch information
ferventcoder committed Jan 28, 2016
1 parent 6c13ca1 commit d5f09bf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit d5f09bf

Please sign in to comment.