Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-design module.js to incorporate generic functions #23

Closed
NeoTheThird opened this issue Nov 24, 2019 · 0 comments · Fixed by #49
Closed

Re-design module.js to incorporate generic functions #23

NeoTheThird opened this issue Nov 24, 2019 · 0 comments · Fixed by #49
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@NeoTheThird
Copy link
Member

To accomplish things like detecting any connected device (eg. ubports/ubports-installer#902), we could reshape module.js to be its own class with instances of all available tools as properties. That way we could create some convenience functions like a tool-agnositc waitForDevice() using something along the lines of Promise.race([adb.waitForDevice(),fastboot.waitForDevice(),heimdall.waitForDevice()]) and returning a string describing the connected mode. You could also go further and attempt os detection and device name detection.

@NeoTheThird NeoTheThird added enhancement New feature or request help wanted Extra attention is needed labels Nov 24, 2019
@NeoTheThird NeoTheThird linked a pull request Nov 5, 2020 that will close this issue
NeoTheThird added a commit that referenced this issue Nov 5, 2020
* Lay the groundwork for generic tool module (#22) to serve as super-class that provides both child_process.spawn() and child_process.exec() (#42)

* Remove nodeJS 10

* Remove NodeJS 12

* Begin separate error handling, first step towards #18

* Move fastboot to new superclass

* Move heimdall to new superclass

* reduce test code verbosity

* WIP move adb to new superclass

* Move ci to github actions

* Update shields

* ONly report coverage once

* STAND BACK I KNOW REGULAR EXPRESSIONS

* Remove coveralls

* codecov.io

* update deps

* remove request import

* update deps

* tweak pipeline

* move statement

* Tweak test scripts

* only report coverage once per run

* add coverage.io badge

* remove janky integration tests

* remove unneeded test files

* Add handleError function to adb module

* begin specific tests for error handling

* unentangle error handling, resolves #18

* const _this

* replace child_process.exec with child_process.execFile for more stability

* Refactor push to use new spawn function. This is awesome! Fixes #27

* re-enable tests

* re-enable more tests

* Fix adb.getSerialno() error handling

* Reduce code verbosity

* Refactor adb.format

* ALL ABOARD THE CODECOV TRAIN

* Begin testing adb.push

* lint

* Cover adb.push

* Implement generic wait function

* deprecate stdoutfilter

* another branch covered

* begin testing backups

* more backup blackbox testing

* Implement experimental exec-out function

* refactor create backup tar

* 100% coverage, resolves #25

* fix windows test assertion

* Flash does not need quotepath any more

* cleanup

* Documentation

* deps

* Refactor fastboot.flash()

* Remove heimdall.flashArray()

* Allow killing subprocesses

* Bugfixes

* Allow fastboot to read device name

* Implement generic module with helper functions, resolves #23

* Improve tests

* improve error logging and document it

* Remove pending tests

* Report sideload progress

* Report correct progress for sparse fastboot images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant