diff --git a/Sources/tart/Commands/Run.swift b/Sources/tart/Commands/Run.swift index 2ec7168..233fb8e 100644 --- a/Sources/tart/Commands/Run.swift +++ b/Sources/tart/Commands/Run.swift @@ -126,8 +126,9 @@ struct Run: AsyncParsableCommand { func additionalDiskAttachments() throws -> [VZDiskImageStorageDeviceAttachment] { var result: [VZDiskImageStorageDeviceAttachment] = [] let readOnlySuffix = ":ro" + let expandedDiskPaths = disk.map { NSString(string:$0).expandingTildeInPath } - for rawDisk in disk { + for rawDisk in expandedDiskPaths { if rawDisk.hasSuffix(readOnlySuffix) { result.append(try VZDiskImageStorageDeviceAttachment( url: URL(fileURLWithPath: String(rawDisk.prefix(rawDisk.count - readOnlySuffix.count))), @@ -166,7 +167,7 @@ struct Run: AsyncParsableCommand { let (name, path) = (String(splits[0]), String(splits[1])) - result.append(DirectoryShare(name: name, path: URL(fileURLWithPath: path), readOnly: readOnly)) + result.append(DirectoryShare(name: name, path: URL(fileURLWithPath: NSString(string: path).expandingTildeInPath), readOnly: readOnly)) } return result