Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e915bc0cfb | ||
|
|
f4c2c75aa1 |
@@ -34,6 +34,11 @@ public extension Bundle {
|
|||||||
var path: Path {
|
var path: Path {
|
||||||
return Path(string: bundlePath)
|
return Path(string: bundlePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the executable for this bundle, if there is one, not all bundles have one hence `Optional`.
|
||||||
|
var executable: Path? {
|
||||||
|
return executablePath.flatMap(Path.init)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extensions on `String` that work with `Path` rather than `String` or `URL`
|
/// Extensions on `String` that work with `Path` rather than `String` or `URL`
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ class PathTests: XCTestCase {
|
|||||||
XCTAssertEqual(bndl.privateFrameworks, tmpdir.Frameworks)
|
XCTAssertEqual(bndl.privateFrameworks, tmpdir.Frameworks)
|
||||||
XCTAssertEqual(bndl.resources, tmpdir)
|
XCTAssertEqual(bndl.resources, tmpdir)
|
||||||
XCTAssertNil(bndl.path(forResource: "foo", ofType: "bar"))
|
XCTAssertNil(bndl.path(forResource: "foo", ofType: "bar"))
|
||||||
|
XCTAssertNil(bndl.executable)
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
XCTAssertEqual(bndl.defaultSharedFrameworksPath, tmpdir.Contents.Frameworks)
|
XCTAssertEqual(bndl.defaultSharedFrameworksPath, tmpdir.Contents.Frameworks)
|
||||||
|
|||||||
Reference in New Issue
Block a user