mxcl / swift-sh

Easily script with third-party Swift dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precisely-specified version dependencies don't work

algal opened this issue · comments

I may be holding it wrong, but I tried updating the example in the README to use a precisely specified version number, by defining a script like so:

#!/usr/bin/swift sh

import Foundation
import PromiseKit  // @mxcl == 6.8.3

firstly {
    after(.seconds(2))
}.then {
    after(.milliseconds(500))
}.done {
    print("notice: two and a half seconds elapsed")
    exit(0)
}

RunLoop.main.run()

I get the following error:

⋊> ~/w/m/S/r/GetUserInfo swift sh foo.swift
/Users/alexis/Library/Developer/swift-sh.cache/foo: error: manifest parse error(s):
/Users/alexis/Library/Developer/swift-sh.cache/foo/Package.swift:10:6: error: ambiguous reference to member 'package'
    .package(url: "https://github.com/mxcl/PromiseKit.git", .exactItem(Version(6,8,3)))
     ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alexis/Library/Developer/swift-sh.cache/foo/Package.swift:10:6: note: overloads for 'package' exist with these partially matching parameter lists: (url: String, Package.Dependency.Requirement), (url: String, Range<Version>), (url: String, ClosedRange<Version>)
    .package(url: "https://github.com/mxcl/PromiseKit.git", .exactItem(Version(6,8,3)))
     ^
error: /usr/bin/swift ["build", "-Xswiftc", "-suppress-warnings"]: 1: <nil> <nil>

Oh. My bad. Apparently I don’t have an integration test for this.

Just raised a PR for this:

#41