Skip to content

Commit

Permalink
Timeout wait steps
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoTheThird committed Nov 5, 2019
1 parent ed555dc commit 2274045
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"jquery-i18next": "^1.2.0",
"mkdirp": "^0.5.1",
"popper.js": "^1.16.0",
"promise-android-tools": "^1.0.9",
"promise-android-tools": "^1.0.10",
"ps-tree": "^1.2.0",
"request": "^2.79.0",
"system-image-node-module": "^1.0.10",
Expand Down
41 changes: 40 additions & 1 deletion src/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,46 @@ function installStep(step) {
global.mainEvent.emit(
"user:action",
global.installConfig.user_actions[step.action],
resolve
() => {
switch (step.action) {
case "recovery":
case "system":
global.mainEvent.emit("user:write:working", "particles");
global.mainEvent.emit(
"user:write:status",
"Waiting for device",
true
);
global.mainEvent.emit(
"user:write:under",
"Adb is scanning for devices"
);
adb
.waitForDevice()
.then(resolve)
.catch(() => mainEvent.emit("user:connection-lost", resolve));
break;
case "bootloader":
global.mainEvent.emit("user:write:working", "particles");
global.mainEvent.emit(
"user:write:status",
"Waiting for device",
true
);
global.mainEvent.emit(
"user:write:under",
"Fastboot is scanning for devices"
);
fastboot
.waitForDevice()
.then(resolve)
.catch(() => mainEvent.emit("user:connection-lost", resolve));
break;
default:
resolve();
break;
}
}
);
});
default:
Expand Down

0 comments on commit 2274045

Please sign in to comment.