Skip to content

Commit 5c00ef6

Browse files
committed
Allow to pass path to argument to exe on Linux
On Linux absolute paths start with '/'.
1 parent bc9d390 commit 5c00ef6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/GitVersionExe/ArgumentParser.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace GitVersion
44
using System.Collections.Generic;
55
using System.Collections.Specialized;
66
using System.ComponentModel;
7+
using System.IO;
78
using System.Linq;
89
using System.Text.RegularExpressions;
910

@@ -42,7 +43,8 @@ public static Arguments ParseArguments(List<string> commandLineArguments)
4243
};
4344
}
4445

45-
if (commandLineArguments.Count == 1 && !(commandLineArguments[0].StartsWith("-") || commandLineArguments[0].StartsWith("/")))
46+
if (commandLineArguments.Count == 1 && !(commandLineArguments[0].StartsWith("-") ||
47+
(commandLineArguments[0].StartsWith("/") && Path.DirectorySeparatorChar != '/')))
4648
{
4749
return new Arguments
4850
{
@@ -52,7 +54,7 @@ public static Arguments ParseArguments(List<string> commandLineArguments)
5254

5355
List<string> namedArguments;
5456
var arguments = new Arguments();
55-
if (firstArgument.StartsWith("-") || firstArgument.StartsWith("/"))
57+
if (firstArgument.StartsWith("-") || (firstArgument.StartsWith("/") && Path.DirectorySeparatorChar != '/'))
5658
{
5759
arguments.TargetPath = Environment.CurrentDirectory;
5860
namedArguments = commandLineArguments;

0 commit comments

Comments
 (0)