Skip to content

Commit

Permalink
Use '\r\n|\n' to split where.exe git.exe result (line#98)
Browse files Browse the repository at this point in the history
Motivation:

If we split a multi-line string with `\r\n`, we saw a multi-line in the returned array.
I guess the result could contain both `\r\n` and `\n` even though it is Windows system.

Modifications:

- Use `\n` or `\r\n` to split a multi-line string

Result:

No longer see an warn message whiling intializing Gradle scripts
  • Loading branch information
ikhoon authored May 10, 2021
1 parent 38f075e commit 7becf88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/common-git.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private def getGitPath() {
if (current() == WINDOWS) {
def commands = executeCommand('where.exe', 'git.exe')
// "where.exe" returns all available commands, so select the first git.exe.
return commands.split('\r\n')[0]
return commands.split('\r\n|\n')[0]
} else {
return executeCommand('which', 'git')
}
Expand Down

0 comments on commit 7becf88

Please sign in to comment.