Skip to content

Commit

Permalink
Merge pull request #227 from PugachA/feature/add-ssh-support-to-uri
Browse files Browse the repository at this point in the history
Add ssh support to DockerUri
  • Loading branch information
mariotoffia authored Oct 27, 2021
2 parents f3a18db + e666ffa commit c7731c9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Ductus.FluentDocker/Model/Common/DockerUri.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Ductus.FluentDocker.Common;
using Ductus.FluentDocker.Extensions;

Expand Down Expand Up @@ -33,11 +33,15 @@ public static string GetDockerHostEnvironmentPathOrDefault()

public override string ToString()
{
if (Scheme != "npipe")
return base.ToString();
var baseString = base.ToString();

var s = base.ToString();
return s.Substring(0, 6) + "//" + s.Substring(6);
if (Scheme == "ssh")
return baseString.TrimEnd('/');

if (Scheme == "npipe")
return baseString.Substring(0, 6) + "//" + baseString.Substring(6);

return baseString;
}
}
}

0 comments on commit c7731c9

Please sign in to comment.