diff --git a/internal/diskutil/diskutil.go b/internal/diskutil/diskutil.go index e1fb28e..3dbeb86 100644 --- a/internal/diskutil/diskutil.go +++ b/internal/diskutil/diskutil.go @@ -105,6 +105,8 @@ func ForProduct(p *system.Product) (DiskUtil, error) { return newSequoia(p.Version) case system.Tahoe: return newTahoe(p.Version) + case system.GoldenGate: + return newGoldenGate(p.Version) default: return nil, errors.New("unknown release") } @@ -190,6 +192,16 @@ func newTahoe(version semver.Version) (*diskutilSonoma, error) { return du, nil } +// newGoldenGate configures the DiskUtil for the specified Golden Gate version. +func newGoldenGate(version semver.Version) (*diskutilSonoma, error) { + du := &diskutilSonoma{ + embeddedDiskutil: &DiskUtilityCmd{}, + dec: &PlistDecoder{}, + } + + return du, nil +} + // embeddedDiskutil is a private interface used to embed UtilImpl into implementation-specific structs. type embeddedDiskutil interface { UtilImpl diff --git a/internal/system/product.go b/internal/system/product.go index 9c69902..6404aca 100644 --- a/internal/system/product.go +++ b/internal/system/product.go @@ -19,6 +19,7 @@ const ( Sonoma Sequoia Tahoe + GoldenGate CompatMode ) @@ -40,6 +41,8 @@ func (r Release) String() string { return "Sequoia" case Tahoe: return "Tahoe" + case GoldenGate: + return "Golden Gate" case CompatMode: return "Compatability Mode" default: @@ -64,6 +67,8 @@ var ( sequoiaConstraints = mustInitConstraint(semver.NewConstraint("~15")) // tahoeConstraints are the constraints used to identify Tahoe versions (26.x.x). tahoeConstraints = mustInitConstraint(semver.NewConstraint("~26")) + // goldenGateConstraints are the constraints used to identify Golden Gate versions (27.x.x). + goldenGateConstraints = mustInitConstraint(semver.NewConstraint("~27")) // compatModeConstraints are the constraints used to identify macOS Big Sur and later. This version is returned // when the system is in compat mode (SYSTEM_VERSION_COMPAT=1). compatModeConstraints = mustInitConstraint(semver.NewConstraint("~10.16")) @@ -124,6 +129,8 @@ func getVersionRelease(version semver.Version) Release { return Sequoia case tahoeConstraints.Check(&version): return Tahoe + case goldenGateConstraints.Check(&version): + return GoldenGate case compatModeConstraints.Check(&version): return CompatMode default: