norrisjeremy commented on code in PR #44:
URL: https://github.com/apache/maven-wrapper/pull/44#discussion_r1111314483


##########
maven-wrapper-distribution/src/resources/mvnw:
##########
@@ -194,7 +194,9 @@ else
       
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar";
     fi
     while IFS="=" read -r key value; do
-      case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;;
+      # Remove '\r' from value to allow usage on windows as IFS does not 
consider '\r' as a separator ( considers space, tab, new line ('\n'), and 
custom '=' )
+      safeValue=$(echo "$value" | sed 's/\r$//')

Review Comment:
   > Or just use a bash variable expansion so we don't need to spawn another 
process. Given everyone is on bash 4 now.
   
   That would be wrong assumption.
   On macOS:
   ```
   $ /bin/sh --version
   GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)
   Copyright (C) 2007 Free Software Foundation, Inc.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to