()
| 46 | } |
| 47 | |
| 48 | function isUsingBatteryDarwin() { |
| 49 | try { |
| 50 | const { stdout } = execa.sync('pmset', ['-g', 'batt']); |
| 51 | |
| 52 | return stdout.indexOf('Battery Power') !== -1; |
| 53 | } catch (ex) { |
| 54 | logger.warn(`Could not get battery status from pmset: ${ex}`); |
| 55 | logger.warn(ex.stack); |
| 56 | |
| 57 | return null; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | function isUsingBatteryLinux() { |
| 62 | const sysClassPowerSupply = isUsingBatterySysClassPowerSupply(); |
no outgoing calls
no test coverage detected
searching dependent graphs…