mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-17 19:36:10 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96c89ad76e | ||
|
|
b78fa6ba1c | ||
|
|
e443cfa9a2 |
@@ -76,8 +76,10 @@ struct Clone: AsyncParsableCommand {
|
|||||||
//
|
//
|
||||||
// So, once we clone the VM let's try to claim the rest of space for the VM to run without errors.
|
// So, once we clone the VM let's try to claim the rest of space for the VM to run without errors.
|
||||||
let unallocatedBytes = try sourceVM.sizeBytes() - sourceVM.allocatedSizeBytes()
|
let unallocatedBytes = try sourceVM.sizeBytes() - sourceVM.allocatedSizeBytes()
|
||||||
if unallocatedBytes > 0 {
|
// Avoid reclaiming an excessive amount of disk space.
|
||||||
try Prune.reclaimIfNeeded(UInt64(unallocatedBytes), sourceVM)
|
let reclaimBytes = min(unallocatedBytes, 100 * 1024 * 1024 * 1024)
|
||||||
|
if reclaimBytes > 0 {
|
||||||
|
try Prune.reclaimIfNeeded(UInt64(reclaimBytes), sourceVM)
|
||||||
}
|
}
|
||||||
}, onCancel: {
|
}, onCancel: {
|
||||||
try? FileManager.default.removeItem(at: tmpVMDir.baseURL)
|
try? FileManager.default.removeItem(at: tmpVMDir.baseURL)
|
||||||
|
|||||||
@@ -87,11 +87,13 @@ struct Exec: AsyncParsableCommand {
|
|||||||
$0.args = Array(command.dropFirst(1))
|
$0.args = Array(command.dropFirst(1))
|
||||||
$0.interactive = interactive
|
$0.interactive = interactive
|
||||||
$0.tty = tty
|
$0.tty = tty
|
||||||
$0.terminalSize = .with {
|
if tty {
|
||||||
let (width, height) = try! Term.GetSize()
|
$0.terminalSize = .with {
|
||||||
|
let (width, height) = try! Term.GetSize()
|
||||||
|
|
||||||
$0.cols = UInt32(width)
|
$0.cols = UInt32(width)
|
||||||
$0.rows = UInt32(height)
|
$0.rows = UInt32(height)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ enum DiskImageFormat: String, CaseIterable, Codable {
|
|||||||
case .raw:
|
case .raw:
|
||||||
return true
|
return true
|
||||||
case .asif:
|
case .asif:
|
||||||
if #available(macOS 15, *) {
|
if #available(macOS 26, *) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -2,13 +2,9 @@ import XCTest
|
|||||||
@testable import tart
|
@testable import tart
|
||||||
|
|
||||||
final class DiskImageFormatTests: XCTestCase {
|
final class DiskImageFormatTests: XCTestCase {
|
||||||
func testRawFormatIsAlwaysSupported() throws {
|
|
||||||
XCTAssertTrue(DiskImageFormat.raw.isSupported)
|
|
||||||
}
|
|
||||||
|
|
||||||
func testASIFFormatSupport() throws {
|
func testASIFFormatSupport() throws {
|
||||||
// ASIF should be supported on macOS 15+
|
// ASIF should be supported on macOS 26+
|
||||||
if #available(macOS 15, *) {
|
if #available(macOS 26, *) {
|
||||||
XCTAssertTrue(DiskImageFormat.asif.isSupported)
|
XCTAssertTrue(DiskImageFormat.asif.isSupported)
|
||||||
} else {
|
} else {
|
||||||
XCTAssertFalse(DiskImageFormat.asif.isSupported)
|
XCTAssertFalse(DiskImageFormat.asif.isSupported)
|
||||||
|
|||||||
Reference in New Issue
Block a user