Skip to content

Commit

Permalink
(GH-542) Rename nuspec.template file
Browse files Browse the repository at this point in the history
Unfortunately nuspec can't be saved as nuspecs in a package. So the
name of the nuspec will need to be *.nuspec.template for it to pack up
nicely. Find that file and rename it to .nuspec on install.
  • Loading branch information
ferventcoder committed Jan 28, 2016
1 parent d5f09bf commit 7b24a9f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,14 @@ private void handle_template_packages(ChocolateyConfiguration config, PackageRes
var templatesFolderToCopy = _fileSystem.directory_exists(templatesPath) ? templatesPath : packageResult.InstallLocation;

FaultTolerance.try_catch_with_logging_exception(
() => _fileSystem.copy_directory(templatesFolderToCopy, installTemplatePath, overwriteExisting: true),
() =>
{
_fileSystem.copy_directory(templatesFolderToCopy, installTemplatePath, overwriteExisting: true);
foreach (var nuspecFile in _fileSystem.get_files(installTemplatePath, "*.nuspec.template").or_empty_list_if_null())
{
_fileSystem.move_file(nuspecFile,nuspecFile.Replace(".nuspec.template",".nuspec"));
}
},
"Attempted to copy{0} '{1}'{0} to '{2}'{0} but had an error".format_with(Environment.NewLine, templatesFolderToCopy, installTemplatePath));

string logMessage = " Installed/updated {0} template.".format_with(templateFolderName);
Expand Down

0 comments on commit 7b24a9f

Please sign in to comment.