10
10
*/
11
11
12
12
const B = require ( 'bluebird' ) ;
13
+ const util = require ( 'util' ) ;
13
14
14
15
// this is here because we're using async/await, and this must be set _before_ we use async/await,
15
16
// given that bluebird is used elsewhere via `doInstall()`.
@@ -31,13 +32,15 @@ async function main() {
31
32
try {
32
33
await fs . stat ( BUILD_PATH ) ;
33
34
} catch {
34
- log . info ( `The Chromedriver install script cannot be found at '${ BUILD_PATH } '. ` +
35
- `Building appium-chromedriver package` ) ;
35
+ log . info (
36
+ `The Chromedriver install script cannot be found at '${ BUILD_PATH } '. ` +
37
+ `Building appium-chromedriver package`
38
+ ) ;
36
39
const npmCommand = process . platform === 'win32' ? 'npm.cmd' : 'npm' ;
37
40
try {
38
41
await exec ( npmCommand , [ 'run' , 'build' ] , { logger : log , cwd : __dirname } ) ;
39
42
} catch ( e ) {
40
- throw new Error ( `appium-chromedriver package cannot be built: ${ e . stderr || e . message } ` ) ;
43
+ throw new Error ( `appium-chromedriver package cannot be built: ${ util . inspect ( e ) } ` ) ;
41
44
}
42
45
}
43
46
@@ -47,11 +50,9 @@ async function main() {
47
50
! _ . isEmpty ( process . env . npm_config_chromedriver_skip_install )
48
51
) {
49
52
log . warn (
50
- `'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable is set; skipping Chromedriver installation.` ,
51
- ) ;
52
- log . warn (
53
- `Android web/hybrid testing will not be possible without Chromedriver.` ,
53
+ `'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable is set; skipping Chromedriver installation.`
54
54
) ;
55
+ log . warn ( `Android web/hybrid testing will not be possible without Chromedriver.` ) ;
55
56
return ;
56
57
}
57
58
@@ -62,7 +63,7 @@ async function main() {
62
63
log . error ( err . stack ? err . stack : err ) ;
63
64
log . error (
64
65
`Downloading Chromedriver can be skipped by setting the` +
65
- `'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.` ,
66
+ `'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.`
66
67
) ;
67
68
process . exit ( 1 ) ;
68
69
}
0 commit comments