MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / isUsingBatteryWindows

Function isUsingBatteryWindows

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

Source from the content-addressed store, hash-verified

106}
107
108function 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
129function memorySwapUsedDarwin() {
130 try {

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…