File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
const {
2
2
spawnSync
3
3
} = require ( 'child_process' ) ;
4
- const { join} = require ( 'path' )
4
+ const path = require ( 'path' )
5
+ const { existsSync} = require ( 'fs' )
5
6
6
7
function determineGradleCommand ( debugLog ) {
7
8
let gradleCommand = null
@@ -12,17 +13,18 @@ function determineGradleCommand(debugLog) {
12
13
debugLog ( 'isWindows: ' + isWindows )
13
14
const gradleWrapperFile = isWindows ? 'gradlew.bat' : 'gradlew'
14
15
15
- const gradleWrapperFilePath = join ( './' , gradleWrapperFile )
16
-
17
- debugLog ( `Checking if wrapper file ${ gradleWrapperFilePath } exists` )
18
- if ( existsSync ( gradleWrapperFilePath ) ) {
16
+ debugLog ( `Checking if wrapper file ${ gradleWrapperFile } exists` )
17
+ if ( existsSync ( gradleWrapperFile ) ) {
19
18
debugLog ( 'Wrapper file exists' )
20
19
gradleCommand = ( isWindows ? '' : './' ) + gradleWrapperFile
21
20
gradleWrapper = true
22
21
} else {
23
22
debugLog ( 'Wrapper file not found' )
24
23
}
25
- } catch ( err ) { }
24
+ } catch ( err ) {
25
+ debugLog ( 'Error trying to determine gradle command.' )
26
+ debugLog ( err )
27
+ }
26
28
27
29
if ( ! gradleCommand ) {
28
30
const gradleVersion = spawnSync ( 'gradle' , [ '--version' ] )
You can’t perform that action at this time.
0 commit comments