Skip to content

Commit 10abff3

Browse files
committed
fix: normalize manifest dir
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent bfd45db commit 10abff3

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
@@ -252,8 +252,11 @@ export default class Java_gradle extends Base_java {
252252
#getProperties(manifestPath, opts) {
253253
let gradle = this.selectToolBinary(manifestPath, opts)
254254
try {
255-
let properties = this._invokeCommand(gradle, ['properties'], {cwd: path.dirname(manifestPath)})
256-
return properties.toString()
255+
const manifestDir = path.normalize(path.dirname(manifestPath));
256+
const commandResult = this._invokeCommand(gradle, ['properties'], {
257+
cwd: manifestDir
258+
})
259+
return commandResult.toString()
257260
} catch (error) {
258261
throw new Error(`Couldn't get properties of ${this._getManifestName()} file , Error message returned from gradle binary => ${EOL} ${error.message}`)
259262
}
@@ -284,7 +287,10 @@ export default class Java_gradle extends Base_java {
284287
#getDependencies(manifest, opts={}) {
285288
const gradle = this.selectToolBinary(manifest, opts)
286289
try {
287-
const commandResult = this._invokeCommand(gradle, ['dependencies'], {cwd: path.dirname(manifest)})
290+
const manifestDir = path.normalize(path.dirname(manifest));
291+
const commandResult = this._invokeCommand(gradle, ['dependencies'], {
292+
cwd: manifestDir
293+
})
288294
return commandResult.toString()
289295
} catch (error) {
290296
throw new Error(`Couldn't run gradle dependencies command, error message returned from gradle binary => ${EOL} ${error.message}`)

0 commit comments

Comments
 (0)