Skip to content

Commit

Permalink
(GH-584) Get version info for other assemblies
Browse files Browse the repository at this point in the history
Allow providing the file/informational version for other loaded
assemblies and not just the currently executing assembly caller.
  • Loading branch information
ferventcoder committed Jan 30, 2016
1 parent 25f49af commit ab0eec4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/chocolatey/infrastructure/information/VersionInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace chocolatey.infrastructure.information

public sealed class VersionInformation
{
public static string get_current_assembly_version()
public static string get_current_assembly_version(IAssembly assembly = null)
{
string version = null;
var executingAssembly = Assembly.GetExecutingAssembly();
string location = executingAssembly != null ? executingAssembly.Location : string.Empty;
if (assembly == null) assembly = Assembly.GetExecutingAssembly();
string location = assembly != null ? assembly.Location : string.Empty;

if (!string.IsNullOrEmpty(location))
{
Expand All @@ -34,11 +34,11 @@ public static string get_current_assembly_version()
return version;
}

public static string get_current_informational_version()
public static string get_current_informational_version(IAssembly assembly = null)
{
string version = null;
var executingAssembly = Assembly.GetExecutingAssembly();
string location = executingAssembly != null ? executingAssembly.Location : string.Empty;
if (assembly == null) assembly = Assembly.GetExecutingAssembly();
string location = assembly != null ? assembly.Location : string.Empty;

if (!string.IsNullOrEmpty(location))
{
Expand Down

0 comments on commit ab0eec4

Please sign in to comment.