()
| 23 | } |
| 24 | |
| 25 | function isUsingBatteryApm() { |
| 26 | try { |
| 27 | const { stdout } = execa.sync('apm', ['-a']); |
| 28 | |
| 29 | return parseInt(stdout, 10) === 0; |
| 30 | } catch (ex) { |
| 31 | logger.warn(`Could not get battery status from apm: ${ex}`); |
| 32 | logger.warn(ex.stack); |
| 33 | |
| 34 | return null; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | function isUsingBatteryBsd() { |
| 39 | const apm = isUsingBatteryApm(); |
no outgoing calls
no test coverage detected
searching dependent graphs…