Skip to content

Commit

Permalink
Make UnsupportedOSError more user-friendly (#192)
Browse files Browse the repository at this point in the history
* Make UnsupportedOSError more user-friendly

* tart prune: allow only specifying a --gc flag
  • Loading branch information
edigaryev authored Aug 24, 2022
1 parent 59393df commit 195a4b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/tart/Commands/Prune.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ struct Prune: AsyncParsableCommand {
var gc: Bool = false

func validate() throws {
if olderThan == nil && cacheBudget == nil {
throw ValidationError("at least one criteria must be specified")
if olderThan == nil && cacheBudget == nil && !gc {
throw ValidationError("at least one pruning criteria must be specified")
}
}

Expand Down
3 changes: 2 additions & 1 deletion Sources/tart/VM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ struct NoMainScreenFoundError: Error {
struct DownloadFailed: Error {
}

struct UnsupportedOSError: Error {
struct UnsupportedOSError: Error, CustomStringConvertible {
private(set) var description: String = "error: Linux VMs are only supported on macOS 13.0 (Ventura) or newer"
}

struct UnsupportedArchitectureError: Error {
Expand Down

0 comments on commit 195a4b3

Please sign in to comment.