eitri-cli 1.13.0-beta.2 → 1.13.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.13.0-beta.2",
3
+ "version": "1.13.0-beta.3",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -100,16 +100,23 @@ module.exports = class AndroidEmulatorService {
100
100
 
101
101
  return new Promise((resolve, _reject) => {
102
102
  exec('adb devices -l', (error, stdout, _stderr) => {
103
- const adbDevices = []
104
103
  if (error) {
105
104
  console.error(`Erro ao executar o comando: ${error}`);
105
+ resolve([]);
106
106
  return;
107
107
  }
108
108
 
109
- const devicesList = stdout.split('\n');
110
- const devices = devicesList.slice(1, -2);
109
+ if(!stdout || stdout.trim() === ""){
110
+ console.error(`'adb devices -l' vazio ou nulo: ${error}`);
111
+ resolve([]);
112
+ return;
113
+ }
114
+
115
+ const adbDevices = []
116
+ const devicesList = stdout?.split('\n');
117
+ const devices = devicesList?.slice(1, -2);
111
118
 
112
- devices.forEach(device => {
119
+ devices?.forEach(device => {
113
120
  adbDevices.push(device)
114
121
  });
115
122
  resolve(adbDevices)