We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 553b363 commit 6ea164cCopy full SHA for 6ea164c
Sources/tart/VMStorageLocal.swift
@@ -12,7 +12,12 @@ class VMStorageLocal {
12
}
13
14
func open(_ name: String) throws -> VMDirectory {
15
- let vmDir = VMDirectory(baseURL: vmURL(name))
+ // support having a path as name for use cases like Vagrant Provider which manages locations of VMs on it's own
16
+ var isDir:ObjCBool = true
17
+ let nameIsPath = FileManager.default.fileExists(atPath: name, isDirectory: &isDir)
18
+ let vmDir = VMDirectory(
19
+ baseURL: nameIsPath ? URL(fileURLWithPath: name) : vmURL(name)
20
+ )
21
22
try vmDir.validate()
23
0 commit comments