| Total Complexity | 3 | 
| Complexity/F | 3 | 
| Lines of Code | 43 | 
| Function Count | 1 | 
| Duplicated Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | import PackageManager from '../client/packageManager'  | 
            ||
| 2 | import Homebrew from '../client/packageManager/homebrew'  | 
            ||
| 3 | import ServiceCtl from '../client/serviceCtl'  | 
            ||
| 4 | import BrewServices from '../client/serviceCtl/brewServices'  | 
            ||
| 5 | |||
| 6 | |||
| 7 | export default class OS { | 
            ||
| 8 | private static instance: OS;  | 
            ||
| 9 | |||
| 10 | operatingSystem: string  | 
            ||
| 11 | packageManager: PackageManager  | 
            ||
| 12 | serviceCtl: ServiceCtl  | 
            ||
| 13 | services: null  | 
            ||
| 14 | usrLocalDir: string  | 
            ||
| 15 | |||
| 16 |     private constructor() { | 
            ||
| 17 |         switch (`${process.platform}_${process.arch}`) { | 
            ||
| 18 | case 'darwin_arm64':  | 
            ||
| 19 | this.operatingSystem = 'darwin_arm64'  | 
            ||
| 20 | this.packageManager = Homebrew.getInstance()  | 
            ||
| 21 | this.serviceCtl = BrewServices.getInstance()  | 
            ||
| 22 | this.services = null  | 
            ||
| 23 | this.usrLocalDir = '/opt/homebrew'  | 
            ||
| 24 | break  | 
            ||
| 25 | default: // darwin x64  | 
            ||
| 26 | this.operatingSystem = 'darwin_x64'  | 
            ||
| 27 | this.packageManager = Homebrew.getInstance()  | 
            ||
| 28 | this.serviceCtl = BrewServices.getInstance()  | 
            ||
| 29 | this.services = null  | 
            ||
| 30 | this.usrLocalDir = '/usr/local'  | 
            ||
| 31 | break  | 
            ||
| 32 | }  | 
            ||
| 33 | }  | 
            ||
| 34 | |||
| 35 |     public static getInstance(): OS { | 
            ||
| 36 |         if (!OS.instance) { | 
            ||
| 37 | OS.instance = new OS()  | 
            ||
| 38 | }  | 
            ||
| 39 | |||
| 40 | return OS.instance  | 
            ||
| 41 | }  | 
            ||
| 42 | }  | 
            ||
| 43 |