Skip to content

Commit

Permalink
(chocolatey#2369) Do not trim forward slash from assembly path on Linux
Browse files Browse the repository at this point in the history
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
  • Loading branch information
2 people authored and tapika committed Jan 30, 2022
1 parent 840f6cc commit ebee73c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public string get_executable_path(string executableName)

public string get_current_assembly_path()
{
return Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", string.Empty);
return Assembly.GetExecutingAssembly().CodeBase.Replace(Platform.get_platform() == PlatformType.Windows ? "file:///" : "file://", string.Empty);
}

#endregion
Expand Down

0 comments on commit ebee73c

Please sign in to comment.