()
| 106 | } |
| 107 | |
| 108 | function isUsingBatteryWindows() { |
| 109 | try { |
| 110 | const { stdout } = execa.sync('wmic', [ |
| 111 | '/namespace:', |
| 112 | '\\\\root\\WMI', |
| 113 | 'path', |
| 114 | 'BatteryStatus', |
| 115 | 'get', |
| 116 | 'PowerOnline', |
| 117 | '/format:list', |
| 118 | ]); |
| 119 | |
| 120 | return /\bPowerOnline=FALSE\b/.test(stdout); |
| 121 | } catch (ex) { |
| 122 | logger.warn(`Could not get battery status from wmic: ${ex}`); |
| 123 | logger.warn(ex.stack); |
| 124 | |
| 125 | return null; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | function memorySwapUsedDarwin() { |
| 130 | try { |
no outgoing calls
no test coverage detected
searching dependent graphs…