Skip to content

Commit

Permalink
Merge pull request #3988 from DerGernTod:create-source-map-windows
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 481014496
  • Loading branch information
Copybara-Service committed Oct 13, 2022
2 parents 830f84a + 55e3c55 commit 7fbe829
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
Expand Up @@ -1133,12 +1133,9 @@ void writeOutput(
@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();
if (dirName != null) {
new File(dirName).mkdirs();
File parent = new File(pathPrefix).getParentFile();
if (parent != null) {
parent.mkdirs();
}
}
}
Expand Down Expand Up @@ -1774,7 +1771,8 @@ void outputJsonStream() throws IOException {
Iterable<JSChunk> modules, B options) throws IOException {
parsedModuleWrappers = parseModuleWrappers(config.moduleWrapper, modules);
if (!isOutputInJson()) {
maybeCreateDirsForPath(config.moduleOutputPathPrefix);
// make sure the method generates all dirs up to the latest /
maybeCreateDirsForPath(config.moduleOutputPathPrefix + "dummy");
}

// If the source map path is in fact a pattern for each
Expand Down

0 comments on commit 7fbe829

Please sign in to comment.