fixes - allow user to pass any path separator as --chunk_output_path_prefix
@@ -1139,10 +1139,14 @@ public abstract class AbstractCommandLineRunner<A extends Compiler, B extends Co
@GwtIncompatible("Unnecessary")
private static void maybeCreateDirsForPath(String pathPrefix) {
if (!Strings.isNullOrEmpty(pathPrefix)) {
- String dirName =
- pathPrefix.charAt(pathPrefix.length() - 1) == File.separatorChar
- ? pathPrefix.substring(0, pathPrefix.length() - 1)
- : new File(pathPrefix).getParent();
+ char sep = pathPrefix.charAt(pathPrefix.length() - 1);
+ String dirName;
+ // allow the user to provide any path separator
+ if (sep == '/' || sep == '\\') {
+ dirName = pathPrefix.substring(0, pathPrefix.length() - 1);
+ } else {
+ dirName = new File(pathPrefix).getParent();
+ }
if (dirName != null) {
new File(dirName).mkdirs();
}
