Skip to content

Commit

Permalink
fix for gradle warpper command
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Nov 28, 2024
1 parent 312b178 commit 55e1a8d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util/commandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function getCommandForGradle(buildGradlePath: string, command: stri
return getGradleCommandForWin(gradleCmdStart, buildGradlePath, command, terminalType, customCommand);
} else {
gradleCmdStart = Path.join(gradleCmdStart, "gradlew");
return formDefaultCommand(gradleCmdStart, buildGradlePath, command, "-b=", customCommand);
return formDefaultCommandWithPath(gradleCmdStart, buildGradlePath, command, "-b=", customCommand);
}
}

Expand Down Expand Up @@ -215,17 +215,17 @@ function formLinuxBasedCommand(cmdStart: string, command: string, wrapperType: S
}

/**
* Returns default command
* Returns default command if 'mvn'/ 'gradle' using for command execution
*/
function formDefaultCommand(projectPath: string, buildFilePath: String, command: string, cmdOption: String, customCommand?: string): string {
function formDefaultCommand(cmdExecutable: string, buildFilePath: String, command: string, cmdOption: String, customCommand?: string): string {
if (customCommand) {
return `${projectPath} ` + `${command}` + ` ${customCommand}` + ` ${cmdOption}"${buildFilePath}"`;
return `${cmdExecutable} ` + `${command}` + ` ${customCommand}` + ` ${cmdOption}"${buildFilePath}"`;
}
return `${projectPath} ` + `${command}` + ` ${cmdOption}"${buildFilePath}"`;
return `${cmdExecutable} ` + `${command}` + ` ${cmdOption}"${buildFilePath}"`;
}

/**
* Returns default format for the command with Path
* Returns default format for the command with wrapper path specified
*/
function formDefaultCommandWithPath(projectPath: string, buildFilePath: String, command: string, cmdOption: String, customCommand?: string): string {
if (customCommand) {
Expand Down

0 comments on commit 55e1a8d

Please sign in to comment.