Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (chocolateyGH-231) nupkg should be created in current directory
  (chocolateyGH-232) Pack includes files from nuspec directory
  (chocolateyGH-164) Fix "The path is not of a legal form"
  • Loading branch information
ferventcoder committed Apr 11, 2015
2 parents 9adaa02 + d0b2336 commit 165aac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public void pack_run(ChocolateyConfiguration config)
{
string nuspecFilePath = validate_and_return_package_file(config, Constants.ManifestExtension);
var nuspecDirectory = _fileSystem.get_full_path(_fileSystem.get_directory_name(nuspecFilePath));
if (string.IsNullOrWhiteSpace(nuspecDirectory)) nuspecDirectory = _fileSystem.get_current_directory();

IDictionary<string, string> properties = new Dictionary<string, string>();
// Set the version property if the flag is set
Expand All @@ -145,7 +146,7 @@ public void pack_run(ChocolateyConfiguration config)
// Initialize the property provider based on what was passed in using the properties flag
var propertyProvider = new DictionaryPropertyProvider(properties);

var basePath = _fileSystem.get_current_directory();
var basePath = nuspecDirectory;
if (config.Information.PlatformType != PlatformType.Windows)
{
//bug with nuspec and tools/** folder location on Windows.
Expand All @@ -159,7 +160,7 @@ public void pack_run(ChocolateyConfiguration config)
}

string outputFile = builder.Id + "." + builder.Version + Constants.PackageExtension;
string outputPath = _fileSystem.combine_paths(nuspecDirectory, outputFile);
string outputPath = _fileSystem.combine_paths(_fileSystem.get_current_directory(), outputFile);

this.Log().Info(() => "Attempting to build package from '{0}'.".format_with(_fileSystem.get_file_name(nuspecFilePath)));

Expand Down
2 changes: 2 additions & 0 deletions src/chocolatey/infrastructure/filesystem/DotNetFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public string combine_paths(string leftItem, params string[] rightItems)

public string get_full_path(string path)
{
if (string.IsNullOrWhiteSpace(path)) return path;

return Path.GetFullPath(path);
}

Expand Down

0 comments on commit 165aac2

Please sign in to comment.