Skip to content

Commit 3af2e67

Browse files
committed
fix: normalize manifest dir
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent 0cbb14d commit 3af2e67

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/providers/java_gradle.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,11 @@ export default class Java_gradle extends Base_java {
200200
#getProperties(manifestPath, opts) {
201201
let gradle = this.selectToolBinary(manifestPath, opts)
202202
try {
203-
let properties = this._invokeCommand(gradle, ['properties'], {cwd: path.dirname(manifestPath)})
204-
return properties.toString()
203+
const manifestDir = path.normalize(path.dirname(manifestPath));
204+
const commandResult = this._invokeCommand(gradle, ['properties'], {
205+
cwd: manifestDir
206+
})
207+
return commandResult.toString()
205208
} catch (error) {
206209
throw new Error(`Couldn't get properties of ${this._getManifestName()} file , Error message returned from gradle binary => ${EOL} ${error.message}`)
207210
}
@@ -243,7 +246,10 @@ export default class Java_gradle extends Base_java {
243246
#getDependencies(manifest, opts={}) {
244247
const gradle = this.selectToolBinary(manifest, opts)
245248
try {
246-
const commandResult = this._invokeCommand(gradle, ['dependencies'], {cwd: path.dirname(manifest)})
249+
const manifestDir = path.normalize(path.dirname(manifest));
250+
const commandResult = this._invokeCommand(gradle, ['dependencies'], {
251+
cwd: manifestDir
252+
})
247253
return commandResult.toString()
248254
} catch (error) {
249255
throw new Error(`Couldn't run gradle dependencies command, error message returned from gradle binary => ${EOL} ${error.message}`)

0 commit comments

Comments
 (0)