-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use node and @puppeteer/browsers to install and sync Chrome and…
… ChromeDriver (#14) * feat: use @puppeteer/browsers to download and sync browsers * test: use @puppeteer/browsers * chore: remove unused shell scripts * chore: remove unused user-files dir placeholder * chore: add @puppeteer/browsers dependency * docs: update README.md * chore: update version * fix: revert version increase * test: throw if detectBrowserPlatform returns undefined * feat: display download progress given the --verbose option * chore: refactor version and which to use commander * test: showing download progress with verbose flag * fix: refactor getEnv to remove race condition * chore: rename filePath to env * chore: use promise versions of fs * feat: throw if an unsupported browser is given * test: unsupported browser and missing env file. * fix: remove redundant resolveBuildId call. * chore: clean up * test: show version without context. * fix: console error s should all throw instead * chore: refactor to use chai-as-promised * test: downloadProgressCallback, and fixes * docs: replace install command * chore: remove unused capitalize function * feat: second installation, feedback response * docs: add JSDocs and remove redundant comments. * all tests passing again * test: invalid version in env file * improve error messages * chore: wrap console.log stub where it's tested or should be suppressed * chore: remove utils file * jsdocs * use 'stable' as default version Co-authored-by: Steven Lambert <[email protected]> * replace version option Co-authored-by: Steven Lambert <[email protected]> * handle version global option * uninstall last * test invalid installations; always await wrapConsoleLobStub --------- Co-authored-by: Steven Lambert <[email protected]>
- Loading branch information
1 parent
c610d9c
commit 469d008
Showing
48 changed files
with
2,974 additions
and
8,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
#!/usr/bin/env node | ||
const { install, version, which } = require('../src/browser-driver-manager.js'); | ||
const { Command } = require('commander'); | ||
const { version: pkgVersion } = require('../package.json'); | ||
|
||
const browserDriverManager = require('../src/browser-driver-manager.js'); | ||
const program = new Command(); | ||
|
||
browserDriverManager(process.argv.slice(2)); | ||
program.version(pkgVersion, '-v, --version'); | ||
|
||
program.command('which') | ||
.description('displays the locations of the installed browser and driver') | ||
.action(which); | ||
program.command('version') | ||
.description('displays the version of the installed browser and driver') | ||
.action(version); | ||
program.command('install') | ||
.description('installs browsers and drivers') | ||
.argument('<browser>', 'the browser and driver to install. Use "chrome" to install Chrome and Chromedriver') | ||
.option('--verbose', 'display additional information about the download process.') | ||
.action(install); | ||
|
||
program.addHelpText('after', ` | ||
Examples: | ||
browser-driver-manager install chrome | ||
browser-driver-manager install chrome@beta | ||
browser-driver-manager version | ||
browser-driver-manager which`) | ||
|
||
program.parse(); |
Oops, something went wrong.