google-java-format icon indicating copy to clipboard operation
google-java-format copied to clipboard

Fails to format files with a space in the path

Open austin-bowen-iss opened this issue 5 years ago • 0 comments

I am running google-java-format on a Windows machine. When I provide it a file (with the "@" syntax) containing a list of files to format, it will fail to format files that contain a space in the path. Example:

>type files.lst
C:\path\with\a space\Some.java

>java -jar google-java-format.jar @files.lst
Skipping non-Java file: C:\path\with\a
space\Some.java: could not read file: space\Some.java

Placing double-quotes around the path does not work, either.

It does, however, handle passing in the filenames in the command string, provided they are surrounded by double-quotes, e.g.:

>java -jar google-java-format.jar "C:\path\with\a space\Some.java"

austin-bowen-iss avatar Dec 04 '19 13:12 austin-bowen-iss