修复File中合成路径的错误
This commit is contained in:
@@ -460,7 +460,7 @@ namespace Convention
|
|||||||
|
|
||||||
#region Operator
|
#region Operator
|
||||||
|
|
||||||
public static ToolFile operator |(ToolFile left, string rightPath)
|
public static ToolFile operator |(ToolFile left, [Opt] string rightPath)
|
||||||
{
|
{
|
||||||
if (rightPath == null)
|
if (rightPath == null)
|
||||||
{
|
{
|
||||||
@@ -472,12 +472,7 @@ namespace Convention
|
|||||||
return new ToolFile(second);
|
return new ToolFile(second);
|
||||||
else if (first == "../")
|
else if (first == "../")
|
||||||
return new ToolFile($"{new ToolFile(left.GetAbsPath()).GetParentDir()}/{second}");
|
return new ToolFile($"{new ToolFile(left.GetAbsPath()).GetParentDir()}/{second}");
|
||||||
return new ToolFile($"{first}/{second}");
|
return new ToolFile($"{first}{(first.EndsWith('/') ? "" : "/")}{second}");
|
||||||
}
|
|
||||||
public static ToolFile operator |(ToolFile left, ToolFile rightPath)
|
|
||||||
{
|
|
||||||
string lp = left.GetFullPath();
|
|
||||||
return new ToolFile(Path.Combine(lp, rightPath));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user