mxcl / swift-sh

Easily script with third-party Swift dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import from private repos (via ssh)

MariusCiocanel opened this issue · comments

I want to start off saying thank you for building swift-sh and all the awesome work you're doing.
Recently I started looking into the Swift Package Manager and then discovered swift-sh.
Eager to try swift-sh out I made a private library installable via SPM and tried importing it in a script using the following syntax:

import Bar  // ssh://git@github.com:mxcl/swift-sh.git ~> 1.0

This format isn't currently supported. Is this something you'd be interested in being included in swift-sh?

I started looking at the regex pattern that parses the import line but I'm not familiar with Regex.

I'll continue to look into it but wanted to raise this issue in case you have any other ideas on how to proceed

So we try to parse the whole string with URL() if it returns a value, we use it. I guess URL doesn't know this form?

But yes, absolutely want to support this.

Tried creating an URL() with an ssh address in a Playground and got a valid URL object.
I managed to find a Regex pattern that matches the existing import specification patterns and adds support for ssh addresses. PR coming soon