MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / isUsingBatteryDarwin

Function isUsingBatteryDarwin

lib/models/hardware-info.js:48–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48function 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
61function isUsingBatteryLinux() {
62 const sysClassPowerSupply = isUsingBatterySysClassPowerSupply();

Callers 1

isUsingBatteryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…